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."