diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 41e9cd51..5586b26b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1152,7 +1152,15 @@ jobs: gh release create "$staged" --draft --target "$GITHUB_SHA" \ --title "$tag" --notes "Automated build of ${GITHUB_SHA:0:7}." - gh release upload "$staged" "${assets[@]}" + # An upload can time out (HTTP 408) on the GitHub side with nothing + # wrong in the build. --clobber replaces an asset a cut-off attempt + # left behind, so trying again is safe. + for attempt in 1 2 3; do + gh release upload --clobber "$staged" "${assets[@]}" && break + [ "$attempt" -lt 3 ] || exit 1 + echo "upload failed; trying again (attempt $attempt of 3)" >&2 + sleep $((attempt * 10)) + done # Sizes, not just presence: an upload cut off partway still leaves a # named asset behind, and a truncated binary is the one outcome this diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 430518d0..0d6d1ccd 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -240,7 +240,15 @@ jobs: gh release create "$staged" --draft --prerelease --latest=false \ --target "$GITHUB_SHA" --title "CodeTrial desktop (main)" \ --notes "Automated desktop build of ${GITHUB_SHA:0:7}. The installers are not signed yet; docs/desktop.md lists what that means on each platform." - gh release upload "$staged" "${assets[@]}" + # An upload can time out (HTTP 408) on the GitHub side with nothing + # wrong in the build. --clobber replaces an asset a cut-off attempt + # left behind, so trying again is safe. + for attempt in 1 2 3; do + gh release upload --clobber "$staged" "${assets[@]}" && break + [ "$attempt" -lt 3 ] || exit 1 + echo "upload failed; trying again (attempt $attempt of 3)" >&2 + sleep $((attempt * 10)) + done # Sizes, not just presence: a cut-off upload still leaves a named # asset behind.