From 1f6564ba04ef334d2125f3d6f83904dd83d8d0f3 Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Mon, 6 Jul 2026 22:13:45 -0400 Subject: [PATCH] fix(ci): release asset upload must be POST multipart, not PUT 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 --- .forgejo/workflows/release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 69295bd..a9274a5 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -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."