-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
pkgbuild.sh
executable file
·33 lines (24 loc) · 1.06 KB
/
pkgbuild.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
set -e
# Suppose we have build/azooKeyMac.app
# Use this script to create a plist package for distribution
# pkgbuild --analyze --root ./build/ pkg.plist
# Create a temporary package
pkgbuild --root ./build/ \
--component-plist pkg.plist --identifier dev.ensan.inputmethod.azooKeyMac \
--version 0 \
--install-location /Library/Input\ Methods \
azooKey-tmp.pkg
# Create a distribution file
# productbuild --synthesize --package azooKey-tmp.pkg distribution.xml
# Build the final package
productbuild --distribution distribution.xml --package-path . azooKey-release.pkg
# Clean up
rm azooKey-tmp.pkg
# Sign Pkg
productsign --sign "Developer ID Installer" ./azooKey-release.pkg ./azooKey-release-signed.pkg
rm azooKey-release.pkg
# Submit for Notarization
# For fork developers: You would need to update `--keychain--profile "Notarytool"` part, because this is environment-depenedent command.
xcrun notarytool submit azooKey-release-signed.pkg --keychain-profile "Notarytool" --wait
# Staple
xcrun stapler staple azooKey-release-signed.pkg