From 63c7f56b8253fd47509736f1aa17c77c53ef0d87 Mon Sep 17 00:00:00 2001 From: Hubert Date: Wed, 28 Oct 2026 10:42:21 +0800 Subject: [PATCH] ci(release): retry stapler validate for the same CloudKit disconnects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Latest run (40621659172) shows notarization Accepted and staple succeeded on retry, then 'stapler validate' died with the identical NSURLErrorDomain -1005 against api.apple-cloudkit.com — validate hits the same ticket lookup and needs the same tolerance. --- .github/workflows/release.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a4efff..198505a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -318,6 +318,20 @@ jobs: return 1 } + # stapler validate also queries Apple's CloudKit for the ticket and + # hits the same transient -1005 disconnects. + validate_with_retry() { + local target="$1" + for attempt in 1 2 3 4 5; do + if xcrun stapler validate "$target"; then + return 0 + fi + echo "validate attempt $attempt for $target failed, retrying in 10s..." + sleep 10 + done + return 1 + } + echo "Stapling notarization ticket to app..." if ! staple_with_retry "$APP_PATH"; then echo "##[error]stapler staple failed for app after 5 attempts" @@ -325,7 +339,10 @@ jobs: fi echo "Verifying notarization..." - xcrun stapler validate "$APP_PATH" + if ! validate_with_retry "$APP_PATH"; then + echo "##[error]stapler validate failed for app after 5 attempts" + exit 1 + fi spctl --assess --type execute --verbose "$APP_PATH" echo "Notarization complete."