From b13f06c0a3538ff962eae2f6fc07cfc81281bf02 Mon Sep 17 00:00:00 2001 From: Gemini Nexus Bot Date: Sat, 2 May 2026 02:28:38 -0300 Subject: [PATCH] ci: upload release assets sequentially with retry Prevents 'HTTP 404: Not Found' and '502 Bad Gateway' errors from GitHub API when attempting to upload many assets simultaneously using the gh cli. --- .github/workflows/publish.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 6e59538..504b2a6 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -118,6 +118,8 @@ jobs: Write-Host "Incompatible WiX Toolset detected: $installed" choco upgrade wixtoolset --version=3.14.0 --allow-downgrade -y } + # Ensure 7zip is available for Squirrel.Windows zip operations + choco install 7zip -y - name: Install dependencies run: pnpm install --frozen-lockfile @@ -223,4 +225,16 @@ jobs: fi printf 'Uploading %s assets to %s\n' "${#files[@]}" "$RELEASE_TAG" - gh release upload "$RELEASE_TAG" "${files[@]}" --clobber + + # Upload files sequentially with retries to prevent GitHub API rate limits and 404/502 errors + for file in "${files[@]}"; do + echo "Uploading $file..." + if ! gh release upload "$RELEASE_TAG" "$file" --clobber; then + echo "::warning::Failed to upload $file. Retrying in 5 seconds..." + sleep 5 + if ! gh release upload "$RELEASE_TAG" "$file" --clobber; then + echo "::error::Failed to upload $file after retry." + exit 1 + fi + fi + done