fix(ci): release asset upload must be POST multipart, not PUT
All checks were successful
CI / build-and-test (push) Successful in 1m6s
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:
parent
daa4068784
commit
1f6564ba04
1 changed files with 6 additions and 4 deletions
|
|
@ -206,11 +206,13 @@ jobs:
|
||||||
-ContentType 'application/json' -Body $body
|
-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"
|
$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 "Authorization: token $env:FORGE_TOKEN" `
|
||||||
-H "Content-Type: application/octet-stream" `
|
-F "attachment=@$env:MSI_PATH" `
|
||||||
--upload-file "$env:MSI_PATH" `
|
|
||||||
"$uploadUri"
|
"$uploadUri"
|
||||||
|
if ($LASTEXITCODE -ne 0) { throw "asset upload failed (curl exit $LASTEXITCODE)" }
|
||||||
Write-Host "Asset $env:MSI_NAME attached to release $env:TAG."
|
Write-Host "Asset $env:MSI_NAME attached to release $env:TAG."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue