Skip to content

Commit 9006bd9

Browse files
aksOpsclaude
andcommitted
fix(ci): widen release-darwin poll budget + early-bail on release-go failure
Both release-go.yml and release-darwin.yml fire on the same tag push. release-go runs goreleaser (CGO + Kuzu + Cosign + SBOM) — typically 4–8 minutes before the Release object appears. release-darwin tried 3 polls × 30s = 90s total and timed out every time: Release v0.X.Y not yet visible, waiting 30s (1/3)... Release v0.X.Y not yet visible, waiting 30s (2/3)... Release v0.X.Y not yet visible, waiting 30s (3/3)... ::error::Release v0.X.Y never appeared; release-go.yml may have failed Both v0.3.0 and v0.4.0 needed a manual `gh run rerun` to recover. Fix: * Bump poll budget to 30 × 30s = 15 minutes (release-go's worst case plus headroom). * On every poll iteration, also check the release-go workflow run status for this tag via `gh run list`. If it concluded as failure/cancelled/timed_out, bail with an actionable error instead of riding the full 15-min timeout to nowhere. * Pin `--repo "$REPO"` on every gh command so the macOS runner's inferred repo (from `gh auth status`) can never disagree with the actual workflow context. Verified the YAML still parses; functional verification will land with the next tag push. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 24fef39 commit 9006bd9

1 file changed

Lines changed: 37 additions & 8 deletions

File tree

.github/workflows/release-darwin.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,52 @@ jobs:
8686
- name: Upload to GitHub Release
8787
env:
8888
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
REPO: ${{ github.repository }}
8990
run: |
9091
VERSION="${TAG#v}"
91-
# Retry up to 3 times to handle race with release-go.yml
92-
# creating the Release.
93-
for i in 1 2 3; do
94-
if gh release view "$TAG" >/dev/null 2>&1; then
95-
gh release upload "$TAG" \
92+
# release-go.yml fires on the same tag push and creates the
93+
# Release via goreleaser. With CGO + Kuzu + cosign + SBOM the
94+
# full pipeline typically lands a Release in 4–8 minutes. We
95+
# poll for up to 15 minutes (30 × 30s) and early-bail if the
96+
# upstream release-go run for this tag already concluded as
97+
# failed / cancelled / timed_out so this job's failure message
98+
# is actionable rather than "timeout after 15m".
99+
MAX_RETRIES=30
100+
SLEEP_SECS=30
101+
go_run_failed=0
102+
for i in $(seq 1 "$MAX_RETRIES"); do
103+
if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then
104+
echo "Release $TAG visible after $((i-1)) wait cycles."
105+
gh release upload "$TAG" --repo "$REPO" \
96106
"codeiq_${VERSION}_darwin_arm64.tar.gz" \
97107
"codeiq_${VERSION}_darwin_arm64.tar.gz.sbom.spdx.json" \
98108
"codeiq_${VERSION}_darwin_arm64.tar.gz.cosign.bundle" \
99109
--clobber
100110
exit 0
101111
fi
102-
echo "Release $TAG not yet visible, waiting 30s ($i/3)..."
103-
sleep 30
112+
go_status=$(gh run list --repo "$REPO" \
113+
--workflow release-go.yml \
114+
--event push \
115+
--branch "$TAG" \
116+
--limit 1 \
117+
--json conclusion,status 2>/dev/null || echo '[]')
118+
conclusion=$(printf '%s' "$go_status" | jq -r '.[0].conclusion // ""')
119+
status=$(printf '%s' "$go_status" | jq -r '.[0].status // ""')
120+
case "$conclusion" in
121+
failure|cancelled|timed_out)
122+
go_run_failed=1
123+
echo "::error::release-go.yml for $TAG ended with conclusion=$conclusion — bailing"
124+
break
125+
;;
126+
esac
127+
echo "Release $TAG not yet visible (release-go status=${status:-unknown} conclusion=${conclusion:-pending}); waiting ${SLEEP_SECS}s ($i/$MAX_RETRIES)..."
128+
sleep "$SLEEP_SECS"
104129
done
105-
echo "::error::Release $TAG never appeared; release-go.yml may have failed"
130+
if [ "$go_run_failed" = "1" ]; then
131+
echo "::error::release-go.yml failed for $TAG; this darwin job cannot proceed"
132+
else
133+
echo "::error::Release $TAG never appeared after $((MAX_RETRIES * SLEEP_SECS))s"
134+
fi
106135
exit 1
107136
- name: Attest darwin archive (build provenance)
108137
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0

0 commit comments

Comments
 (0)