From e6275b2d25c7c5db46bd0a57e4b0ca5c52a26513 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:47:25 +0100 Subject: [PATCH] macOS notarization: add automatic retry Backport of #25996 --- build/ci/macos/notarize.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build/ci/macos/notarize.sh b/build/ci/macos/notarize.sh index 052bc44bf1ca8..49b8be1994c90 100755 --- a/build/ci/macos/notarize.sh +++ b/build/ci/macos/notarize.sh @@ -30,7 +30,22 @@ echo "ARTIFACT_NAME: $ARTIFACT_NAME" echo "Uploading to apple to notarize..." -xcrun notarytool submit --apple-id $APPLE_USERNAME --team-id $APPLE_TEAM_ID --password $APPLE_PASSWORD --wait $ARTIFACTS_DIR/$ARTIFACT_NAME +for i in 1 2 3; do + c=0 + xcrun notarytool submit \ + --apple-id $APPLE_USERNAME \ + --team-id $APPLE_TEAM_ID \ + --password $APPLE_PASSWORD \ + --wait $ARTIFACTS_DIR/$ARTIFACT_NAME \ + || c=$? + if [ $c -eq 0 ]; then break; fi + if [ $i -eq 3 ]; then + echo "notarytool failed; exiting after 3 retries." + exit 1 + fi + echo "notarytool failed; retrying in 30s" + sleep 30 +done echo "Stapling and running packaging up" xcrun stapler staple $ARTIFACTS_DIR/$ARTIFACT_NAME