forked from BeamMW/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notarize.sh
36 lines (34 loc) · 1.22 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
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# set -e
# Notarize the dmg
notarize_dmg() {(
echo "Uploading $BEAM_WALLET_UI_IN to notarization service"
uploadRes=$(xcrun altool --notarize-app --primary-bundle-id "com.mw.beam.beamwallet" --username "$MACOS_NOTARIZE_USER" --password "$MACOS_NOTARIZE_PASS" --file "$BEAM_WALLET_UI_IN" --verbose 2>&1)
echo "Result: $uploadRes"
uuid=$(echo "$uploadRes" | grep 'RequestUUID' | awk '{ print $3 }')
if [ "$uuid" = "" ]; then
echo "Uploading to notarization service error"
exit 1
else
echo "Successfully uploaded to notarization service, polling for result: $uuid"
fi
sleep 15
while :
do
fullstatus=$(xcrun altool --notarization-info "$uuid" --username "$MACOS_NOTARIZE_USER" --password "$MACOS_NOTARIZE_PASS" --verbose 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