-
Notifications
You must be signed in to change notification settings - Fork 5
/
sign-macos.sh
executable file
·50 lines (30 loc) · 1.13 KB
/
sign-macos.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
49
#!/usr/bin/env bash
if [ ! -e ./cred-macos ]; then
echo "cred-macos not found, abort"
echo "Must define DEVELOPER_ID_APPLICATION, TEAM_ID and PASS."
exit 1
fi
source ./cred-macos
# https://melatonin.dev/blog/how-to-code-sign-and-notarize-macos-audio-plugins-in-ci/
VERSION=$(grep project CMakeLists.txt \
| awk 'match($0, /[0-9]+.[0-9]+.[0-9]/) {print substr($0, RSTART, RLENGTH)}')
ARCH=$(uname -m)
pushd build-macos
rm -fr dist
mkdir dist
pushd dist
cp -a -R ../deCONZ.app .
#codesign --force -s "${DEVELOPER_ID_APPLICATION}" -v $PWD/deCONZ.app --deep --strict --options=runtime --timestamp
# verify signing (debug)
#codesign -dv --verbose=4 $PWD/deCONZ.app
rm -f *.zip
# compress exactly like Finder does
ditto -c -k --sequesterRsrc --keepParent deCONZ.app deconz_${VERSION}-macos_${ARCH}.zip
xcrun notarytool submit deconz_${VERSION}-macos_${ARCH}.zip \
--apple-id phoscon.developer@gmail.com \
--password ${PASS} --team-id $TEAM_ID --wait
xcrun stapler staple deCONZ.app
mv *.zip deconz_${VERSION}-macos_${ARCH}_unstapled.zip
ditto -c -k --sequesterRsrc --keepParent deCONZ.app deconz_${VERSION}-macos_${ARCH}.zip
popd
popd