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