From 82f2ad6406f8d46d2284346fc51bfe7dbdddb5e3 Mon Sep 17 00:00:00 2001 From: Hubert Date: Tue, 27 Oct 2026 22:00:42 +0800 Subject: [PATCH] ci(release): extend notarization wait and fail closed on non-Accepted status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous run reached Apple's service but --wait timed out at 30m before processing completed (submission 9cb6311e...), then stapler failed with 'Record not found'. Signatures are no longer rejected — that path is fixed. - Raise notarytool --timeout to 120m for both app and DMG submissions - Treat any non-Accepted outcome as a hard failure, print the submission id and current status, instead of continuing to stapler --- .github/workflows/release.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f23fde..df4745c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -273,10 +273,11 @@ jobs: --password "$APPLE_APP_SPECIFIC_PASSWORD" \ --team-id "$APPLE_TEAM_ID" \ --wait \ - --timeout 30m 2>&1 | tee "$SUBMIT_LOG" + --timeout 120m 2>&1 | tee "$SUBMIT_LOG" - # notarytool exits 0 even for status: Invalid — surface the rejection - # and Apple's issue list instead of failing later at stapler with 65. + # notarytool exits 0 even for status: Invalid or a wait timeout — + # surface the failure (and Apple's issue list) instead of failing + # later at stapler with exit 65 / "Record not found". if grep -q "status: Invalid" "$SUBMIT_LOG"; then SUBMIT_ID=$(grep -oE 'id: [0-9a-f-]{36}' "$SUBMIT_LOG" | head -1 | awk '{print $2}') echo "Notarization Invalid. Fetching Apple's issues for submission ${SUBMIT_ID:-}..." @@ -290,6 +291,19 @@ jobs: exit 1 fi + if ! grep -q "status: Accepted" "$SUBMIT_LOG"; then + SUBMIT_ID=$(grep -oE 'id: [0-9a-f-]{36}' "$SUBMIT_LOG" | head -1 | awk '{print $2}') + echo "##[error]Notarization did not reach Accepted (timeout or unknown status). Submission: ${SUBMIT_ID:-}" + if [ -n "$SUBMIT_ID" ]; then + echo "Polling the submission in case Apple finished after the wait window..." + xcrun notarytool info "$SUBMIT_ID" \ + --apple-id "$APPLE_ID" \ + --password "$APPLE_APP_SPECIFIC_PASSWORD" \ + --team-id "$APPLE_TEAM_ID" || true + fi + exit 1 + fi + echo "Stapling notarization ticket to app..." xcrun stapler staple "$APP_PATH" @@ -323,7 +337,7 @@ jobs: --password "$APPLE_APP_SPECIFIC_PASSWORD" \ --team-id "$APPLE_TEAM_ID" \ --wait \ - --timeout 30m + --timeout 120m xcrun stapler staple "$DMG_FILE" cp "$DMG_FILE" "$ARM64_DMG_FILE"