-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathreleaseme
executable file
·59 lines (42 loc) · 1.77 KB
/
releaseme
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
50
51
52
53
54
55
56
57
58
59
#!/bin/zsh -ex
./fixarch;
mypy ./src;
rm -fr ./dist;
# https://github.com/ronaldoussoren/py2app/issues/444
python setup.py py2app | cat;
. "${HOME}/.signing-vars.sh";
# ^ fill out this file with identity-specific stuff:
# NOTARIZE_IDENTITY= # one of the SHA1 certificate hashes from `security find-identity -v -p codesigning`
# NOTARIZE_TEAM_ID= # the thing in parentheses in the output of that command
# NOTARIZE_APPLE_ID= # the apple ID of the developer account that retrieved that certificate
# NOTARIZE_PROFILE= # the string that you previously passed to `xcrun notarytool store-credentials "${NOTARIZE_PROFILE}" --apple-id "${NOTARIZE_APPLE_ID}" --team-id "${NOTARIZE_TEAM_ID}"`
. ./.signing-vars.sh
# ^ fill out this file with application-specific stuff
# APPLICATION_NAME= should be the file name of the .app; Foo for Foo.app
# store credentials with:
# notarytool
cd dist;
find "${APPLICATION_NAME}.app" -iname '*.so' -or -iname '*.dylib' |
while read libfile; do
codesign --sign "${NOTARIZE_IDENTITY}" \
--entitlements ../python-entitlements.plist \
--deep "${libfile}" \
--force \
--options runtime;
done;
codesign --sign "${NOTARIZE_IDENTITY}" \
--entitlements ../python-entitlements.plist \
--deep "${APPLICATION_NAME}.app" \
--force \
--options runtime;
zip -yr \
"${APPLICATION_NAME}.app.zip" \
"${APPLICATION_NAME}.app";
xcrun notarytool submit \
"${APPLICATION_NAME}.app.zip" \
--apple-id="${NOTARIZE_APPLE_ID}" \
--team-id="${NOTARIZE_TEAM_ID}" \
--keychain-profile="${NOTARIZE_PROFILE}" \
--wait
xcrun stapler staple "./${APPLICATION_NAME}.app";
zip -qyr "${APPLICATION_NAME}.notarized.app.zip" "${APPLICATION_NAME}.app";