forked from BeamMW/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notarize.sh
28 lines (26 loc) · 1.03 KB
/
notarize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
# Notarize the dmg
notarize_dmg() {(
echo "Uploading $BEAM_WALLET_UI_IN to notarization service"
uuid=`xcrun altool --notarize-app --primary-bundle-id "com.mw.beam.beamwallet" --username "$MACOS_NOTARIZE_USER" --password "$MACOS_NOTARIZE_PASS" --file "$BEAM_WALLET_UI_IN" 2>&1 | grep 'RequestUUID' | awk '{ print $3 }'`
echo "Successfully uploaded to notarization service, polling for result: $uuid"
sleep 15
while :
do
fullstatus=`xcrun altool --notarization-info "$uuid" --username "$MACOS_NOTARIZE_USER" --password "$MACOS_NOTARIZE_PASS" 2>&1`
status=`echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }'`
if [ "$status" = "success" ]; then
xcrun stapler staple "$BEAM_WALLET_UI_IN"
echo "Notarization success"
return
elif [ "$status" = "in" ]; then
echo "Notarization still in progress, sleeping for 15 seconds and trying again"
sleep 15
else
echo "Notarization failed fullstatus below"
echo "$fullstatus"
exit 1
fi
done
)}
notarize_dmg