summaryrefslogtreecommitdiff
path: root/branding/scripts/osx-stapler.sh
blob: 5017f0b957cac2fb8da94a151921910b7633ae21 (plain)
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
#!/bin/bash
# Notes to script notarization steps.
# To be called from the root folder.
# Taken from https://oozou.com/blog/scripting-notarization-for-macos-app-distribution-38

# TODO: put pass in keychain
# --password "@keychain:notarization-password"

USER=info@leap.se

requestInfo=$(xcrun altool --notarize-app \
	-t osx -f build/installer/${APPNAME}-installer-${VERSION}.zip \
	--primary-bundle-id="se.leap.bitmask.${TARGET}" \
	-u ${USER} \
	-p ${OSXAPPPASS})

uuid=$(python branding/scripts/osx-get-uuid.py $requestInfo)

current_status = "in progress"

while [[ "$currentStatus" == "in progress" ]]; do

sleep 15

statusResponse=$(xcrun altool --notarization-info "$uuid" \
    --username ${USER} \
    --password ${OSXAPPPASS})
current_status=$(python branding/scripts/osx-get-status.py $statusResponse)
done


if [[ "$current_status" == "success" ]]; then
  # staple notarization here
  xcrun stapler staple build/installer/${APPNAME}-installer-${VERSION}.app
  create-dmg deploy/${APPNAME}-${VERSION}.dmg build/installer/${APPNAME}-installer-${VERSION}.app
else
  echo "Error! The status was $current_status. There were errors. Please check the LogFileURL for error descriptions"
  exit 1
fi