forked from XcodesOrg/xcodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notarize.sh
executable file
·48 lines (43 loc) · 1.28 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
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#
# notarize.sh
#
# E.g. ./notarize.sh "[email protected]" "@keychain:altool" MyOrg xcodes.zip
#
# Adapted from https://github.com/keybase/client/blob/46f5df0aa64ff19198ba7b044bbb7cd907c0be9f/packaging/desktop/package_darwin.sh
username="$1"
password="$2"
asc_provider="$3"
file="$4"
echo "Uploading to notarization service"
uuid=$(xcrun altool \
--notarize-app \
--primary-bundle-id "com.robotsandpencils.xcodes.zip" \
--username "$username" \
--password "$password" \
--asc-provider "$asc_provider" \
--file "$file" 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 "$username" \
--password "$password" \
--asc-provider "$asc_provider" 2>&1)
status=$(echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }')
if [ "$status" = "success" ]; then
echo "Notarization success"
exit 0
elif [ "$status" = "in" ]; then
echo "Notarization still in progress, sleeping for 15 seconds and trying again"
sleep 15
else
echo "Notarization failed, full status below"
echo "$fullstatus"
exit 1
fi
done