From 056988865c24aea6335846c5bc3e5bd1492eb11e Mon Sep 17 00:00:00 2001 From: Kasper Hirvikoski Date: Sat, 26 Feb 2022 19:26:59 +0200 Subject: [PATCH] =?UTF-8?q?Use=20=E2=80=9Cxcodebuild=20archive=E2=80=9D=20?= =?UTF-8?q?to=20sign=20all=20assets=20automatically?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- export.plist | 8 ++++++++ release | 21 ++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 export.plist diff --git a/export.plist b/export.plist new file mode 100644 index 00000000..055f67c2 --- /dev/null +++ b/export.plist @@ -0,0 +1,8 @@ + + + + + method + developer-id + + diff --git a/release b/release index c2844ae6..4fc1f6fd 100755 --- a/release +++ b/release @@ -90,6 +90,7 @@ fi # Build app +build_directory="$PWD/build" version=$(get_build_setting 'MARKETING_VERSION') build_number=$(get_build_setting 'CURRENT_PROJECT_VERSION') notarisation_archive="phoenix-$version.zip" @@ -104,18 +105,25 @@ fi describe "Building $app..." +rm -rf $build_directory + xcodebuild -workspace $app.xcworkspace \ -scheme $app \ -configuration Release \ - SYMROOT="$PWD/build/" \ + -archivePath "$build_directory/$app.xcarchive" \ CODE_SIGN_IDENTITY="$code_sign_identity" \ - clean build + clean archive + +xcodebuild -archivePath "$build_directory/$app.xcarchive" \ + -exportArchive \ + -exportPath $build_directory \ + -exportOptionsPlist export.plist # Verify app describe 'Verifying signed app...' -cd build/Release/ +cd $build_directory codesign --verbose=4 --verify $app.app spctl --verbose=4 --assess --type execute $app.app @@ -147,12 +155,19 @@ do > $notarisation_info_plist notarisation_status=$(get_property 'notarization-info:Status' $notarisation_info_plist) + if [ "$notarisation_status" = 'success' ]; then notarisation_log=$(get_property 'notarization-info:LogFileURL' $notarisation_info_plist) echo "Notarisation succeeded. Log: $notarisation_log" break fi + if [ "$notarisation_status" = 'invalid' ]; then + notarisation_log=$(get_property 'notarization-info:LogFileURL' $notarisation_info_plist) + echo "Notarisation failed. Log: $notarisation_log" + exit 1 + fi + echo "Current status is “"$notarisation_status"”. Waiting..." sleep 30 done