ci: retry transient macOS sign/notary flakes in the publish step (#2266)

Releases fail intermittently on transient macOS issues that hit EITHER
macOS leg, not just Intel: Apple notary -1009 connection-offline (seen on
macos-latest/arm64) and osx-sign keychain races, code object is not signed
at all (seen on macos-15-intel). Both pass on a manual re-run.

Wrap npm run publish in a 3x retry with backoff in all four release/nightly
publish steps so these self-heal in-place instead of failing the run (and,
for nightly, skipping the whole feed). Keeps the Intel leg coupled so the
x64 feed entry stays guaranteed.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Harshit Singh Bhandari 2026-06-29 03:58:19 +05:30 committed by GitHub
parent 6b56b1c245
commit 92a52f0992
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 4 deletions

View File

@ -85,7 +85,16 @@ jobs:
apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }} apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }}
apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }} apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }}
- name: Publish - name: Publish
run: npm run publish run: |
# Retry transient macOS sign/notary flakes (Apple notary -1009,
# osx-sign keychain races) so the build self-heals instead of failing.
for i in 1 2 3; do
if npm run publish; then exit 0; fi
echo "::warning::publish attempt $i/3 failed (likely a transient macOS sign/notary flake)"
[ "$i" -lt 3 ] && sleep 30
done
echo "::error::publish failed after 3 attempts" >&2
exit 1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AO_RELEASE_REPO: ${{ github.repository }} AO_RELEASE_REPO: ${{ github.repository }}
@ -135,7 +144,16 @@ jobs:
apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }} apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }}
apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }} apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }}
- name: Publish - name: Publish
run: npm run publish run: |
# Retry transient macOS sign/notary flakes (Apple notary -1009,
# osx-sign keychain races) so the build self-heals instead of failing.
for i in 1 2 3; do
if npm run publish; then exit 0; fi
echo "::warning::publish attempt $i/3 failed (likely a transient macOS sign/notary flake)"
[ "$i" -lt 3 ] && sleep 30
done
echo "::error::publish failed after 3 attempts" >&2
exit 1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AO_RELEASE_REPO: ${{ github.repository }} AO_RELEASE_REPO: ${{ github.repository }}

View File

@ -76,7 +76,16 @@ jobs:
apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }} apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }}
apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }} apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }}
- name: Publish - name: Publish
run: npm run publish run: |
# Retry transient macOS sign/notary flakes (Apple notary -1009,
# osx-sign keychain races) so the build self-heals instead of failing.
for i in 1 2 3; do
if npm run publish; then exit 0; fi
echo "::warning::publish attempt $i/3 failed (likely a transient macOS sign/notary flake)"
[ "$i" -lt 3 ] && sleep 30
done
echo "::error::publish failed after 3 attempts" >&2
exit 1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AO_RELEASE_REPO: ${{ github.repository }} AO_RELEASE_REPO: ${{ github.repository }}
@ -191,7 +200,16 @@ jobs:
apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }} apple-api-issuer: ${{ secrets.APPLE_API_ISSUER }}
apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }} apple-signing-identity: ${{ secrets.APPLE_SIGNING_IDENTITY }}
- name: Publish - name: Publish
run: npm run publish run: |
# Retry transient macOS sign/notary flakes (Apple notary -1009,
# osx-sign keychain races) so the build self-heals instead of failing.
for i in 1 2 3; do
if npm run publish; then exit 0; fi
echo "::warning::publish attempt $i/3 failed (likely a transient macOS sign/notary flake)"
[ "$i" -lt 3 ] && sleep 30
done
echo "::error::publish failed after 3 attempts" >&2
exit 1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AO_RELEASE_REPO: ${{ github.repository }} AO_RELEASE_REPO: ${{ github.repository }}