Skip to content

Commit

Permalink
Use “xcodebuild archive” to sign all assets automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper committed Feb 26, 2022
1 parent bcd7fd1 commit 0569888
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
8 changes: 8 additions & 0 deletions export.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>developer-id</string>
</dict>
</plist>
21 changes: 18 additions & 3 deletions release
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0569888

Please sign in to comment.