@@ -37,37 +37,51 @@ function notarizePayloadWithBundleID {
37
37
NOTARIZATION_TMP_DIR=" $( mktemp -d) "
38
38
39
39
echo " ####### Notarize distribution package"
40
-
40
+ echo " Working directory in ${NOTARIZATION_TMP_DIR} "
41
41
echo " ### Requesting notarization"
42
42
xcrun altool --notarize-app --primary-bundle-id " ${NOTARIZATION_BUNDLE_ID} " -u " ${NOTARIZATION_DEVELOPER_ID_LOGIN} " -p " ${NOTARIZATION_DEVELOPER_ID_PASSWORD} " -f " ${NOTARIZATION_PAYLOAD_PATH} " --output-format xml > " ${NOTARIZATION_TMP_DIR} /notarize-app.plist"
43
43
44
44
if [ $? -ne 0 ]
45
45
then
46
46
showNotarizationErrors " ${NOTARIZATION_TMP_DIR} /notarize-app.plist"
47
- exit 1
47
+ exit $LINENO
48
48
fi
49
49
50
50
NOTARIZATION_UUID=$( /usr/libexec/PlistBuddy -c " Print :notarization-upload:RequestUUID" " ${NOTARIZATION_TMP_DIR} /notarize-app.plist" 2> /dev/null)
51
51
52
+ echo " Notarization request UUID is ${NOTARIZATION_UUID} "
53
+
52
54
if [ -z " {NOTARIZATION_UUID}" ]
53
55
then
54
56
echo " #### NOTARIZATION ERROR ####"
55
57
echo " No UUID returned"
56
58
showNotarizationErrors " ${NOTARIZATION_TMP_DIR} /notarize-app.plist"
57
- exit 2
59
+ exit $LINENO
58
60
fi
59
61
60
62
NOTARIZATION_STATUS=" in progress"
61
63
echo " ### Wait for notarization to complete"
62
- while [ " ${NOTARIZATION_STATUS} " == " in progress" ]
64
+ sleep 10
65
+ while [ " ${NOTARIZATION_STATUS} " != " success" ]
63
66
do
64
67
xcrun altool --notarization-info " ${NOTARIZATION_UUID} " -u " ${NOTARIZATION_DEVELOPER_ID_LOGIN} " -p " ${NOTARIZATION_DEVELOPER_ID_PASSWORD} " --output-format xml > " ${NOTARIZATION_TMP_DIR} /notarization-info.plist"
65
68
NOTARIZATION_STATUS=$( /usr/libexec/PlistBuddy -c " Print :notarization-info:Status" " ${NOTARIZATION_TMP_DIR} /notarization-info.plist" 2> /dev/null)
66
69
70
+ echo " Current notarization status: '${NOTARIZATION_STATUS} '"
71
+
67
72
if [ " ${NOTARIZATION_STATUS} " == " in progress" ]
68
73
then
69
- echo -n " ."
70
- sleep 5
74
+ sleep 10
75
+ elif [ " ${NOTARIZATION_STATUS} " == " " ]
76
+ then
77
+ echo " No status found for request ${NOTARIZATION_UUID} "
78
+ $( /usr/libexec/PlistBuddy -c " Print :product-errors:$i :message" " ${NOTARIZATION_TMP_DIR} /notarization-info.plist" 2> /dev/null)
79
+ echo " Some delay in the API processing may exist"
80
+ sleep 20
81
+ elif [ " ${NOTARIZATION_STATUS} " != " success" ]
82
+ then
83
+ showNotarizationErrors " ${NOTARIZATION_TMP_DIR} /notarization-info.plist"
84
+ exit $LINENO
71
85
fi
72
86
done
73
87
@@ -107,7 +121,7 @@ function notarizePayloadWithBundleID {
107
121
xcrun stapler staple " ${NOTARIZATION_PAYLOAD_PATH} "
108
122
else
109
123
showNotarizationErrors " ${NOTARIZATION_TMP_DIR} /notarization-info.plist"
110
- exit 3
124
+ exit $LINENO
111
125
fi
112
126
113
127
rm -rf " ${NOTARIZATION_TMP_DIR} "
145
159
echo " is some uncommited change to the repo."
146
160
echo " Please, commit and try again or use"
147
161
echo " a development branch."
148
- exit 1
162
+ exit $LINENO
149
163
fi
150
164
fi
151
165
0 commit comments