From 99da6507fcb6746cf899c6c4dd77c23017524049 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 8 Dec 2023 16:43:16 +0100 Subject: [PATCH] osx builds: use notarytool --- contrib/osx/notarize_app.sh | 55 ++++++------------------------------- 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/contrib/osx/notarize_app.sh b/contrib/osx/notarize_app.sh index 27f4a6dfe..a195c066c 100755 --- a/contrib/osx/notarize_app.sh +++ b/contrib/osx/notarize_app.sh @@ -7,7 +7,7 @@ if [ -z "$1" ]; then exit 1 fi -if [ -z "$APPLE_ID_USER" ] || [ -z "$APPLE_ID_PASSWORD" ]; then +if [ -z "$APPLE_ID_USER" ] || [ -z "$APPLE_ID_PASSWORD" ] || [ -z "$APPLE_TEAM_ID" ]; then echo "You need to set your Apple ID credentials with \$APPLE_ID_USER and \$APPLE_ID_PASSWORD." exit 1 fi @@ -23,12 +23,12 @@ ditto -c -k --rsrc --keepParent "$APP_BUNDLE" "${APP_BUNDLE}.zip" # Submit for notarization echo "Submitting $APP_BUNDLE for notarization..." -RESULT=$(xcrun altool --notarize-app --type osx \ - --file "${APP_BUNDLE}.zip" \ - --primary-bundle-id org.electrum.electrum \ - --username $APPLE_ID_USER \ - --password @env:APPLE_ID_PASSWORD \ - --output-format xml +RESULT=$(xcrun notarytool submit \ + --team-id $APPLE_TEAM_ID \ + --apple-id $APPLE_ID_USER \ + --password $APPLE_ID_PASSWORD \ + --wait \ + "${APP_BUNDLE}.zip" ) if [ $? -ne 0 ]; then @@ -37,45 +37,8 @@ if [ $? -ne 0 ]; then exit 1 fi -REQUEST_UUID=$(echo "$RESULT" | xpath \ - "//key[normalize-space(text()) = 'RequestUUID']/following-sibling::string[1]/text()" 2>/dev/null -) - -if [ -z "$REQUEST_UUID" ]; then - echo "Submitting $APP_BUNDLE failed:" - echo "$RESULT" - exit 1 -fi - -echo "$(echo "$RESULT" | xpath \ - "//key[normalize-space(text()) = 'success-message']/following-sibling::string[1]/text()" 2> /dev/null)" - -# Poll for notarization status -echo "Submitted notarization request $REQUEST_UUID, waiting for response..." -sleep 60 -while : -do - RESULT=$(xcrun altool --notarization-info "$REQUEST_UUID" \ - --username "$APPLE_ID_USER" \ - --password @env:APPLE_ID_PASSWORD \ - --output-format xml - ) - STATUS=$(echo "$RESULT" | xpath \ - "//key[normalize-space(text()) = 'Status']/following-sibling::string[1]/text()" 2>/dev/null - ) - - if [ "$STATUS" = "success" ]; then - echo "Notarization of $APP_BUNDLE succeeded!" - break - elif [ "$STATUS" = "in progress" ]; then - echo "Notarization in progress..." - sleep 20 - else - echo "Notarization of $APP_BUNDLE failed:" - echo "$RESULT" - exit 1 - fi -done +# success +echo $RESULT # Staple the notary ticket xcrun stapler staple "$APP_BUNDLE"