fix(ci): release asset upload must be POST multipart, not PUT
All checks were successful
CI / build-and-test (push) Successful in 1m6s

curl --upload-file issues a PUT, which Forgejo answers with 405 -- the
attach-MSI step would have failed on every release. Switch to
-X POST -F attachment=@file and fail the step on curl errors instead of
masking them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Zac Gaetano 2026-07-06 22:13:45 -04:00
parent daa4068784
commit 1f6564ba04

View file

@ -206,11 +206,13 @@ jobs:
-ContentType 'application/json' -Body $body
}
# Upload the MSI as an asset.
# Upload the MSI as an asset. Must be POST multipart/form-data —
# curl's --upload-file does a PUT, which Forgejo answers with 405
# (verified against Forgejo 2026-07-06 while shipping 1.2.0-beta.1).
$uploadUri = "$env:FORGE_API/releases/$($release.id)/assets?name=$env:MSI_NAME"
curl.exe -fSL `
curl.exe -fSL -X POST `
-H "Authorization: token $env:FORGE_TOKEN" `
-H "Content-Type: application/octet-stream" `
--upload-file "$env:MSI_PATH" `
-F "attachment=@$env:MSI_PATH" `
"$uploadUri"
if ($LASTEXITCODE -ne 0) { throw "asset upload failed (curl exit $LASTEXITCODE)" }
Write-Host "Asset $env:MSI_NAME attached to release $env:TAG."