-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-installer
executable file
·52 lines (45 loc) · 1.19 KB
/
build-installer
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
#!/bin/bash
ROOT_DIR=$(dirname "$0")
PUBLIC_DIR="$ROOT_DIR/public"
TMP_DIR="$ROOT_DIR/tmp"
APP_IN_PATH="$TMP_DIR/Pop Pixie.app"
APP_ZIP_PATH="$TMP_DIR/Pop Pixie.zip"
APP_OUT_PATH="$PUBLIC_DIR/Pop Pixie.app"
DMG_PATH="$ROOT_DIR/Install Pop Pixie.dmg"
ls "$APP_IN_PATH" &>/dev/null || {
echo "Error: '$APP_PATH' does not exist" >/dev/stderr
exit 1
}
rm "$DMG_PATH" &>/dev/null
codesign \
--deep \
--force \
--verify \
--verbose \
--timestamp \
--options \
runtime \
--entitlements \
"$ROOT_DIR/pop-pixie.entitlements" \
--sign "Developer ID Application: Joe Anderson (Z598L5A457)" \
"$APP_IN_PATH" || {
echo "Error: Failed to sign application" >/dev/stderr
exit 1
}
ditto -c -k --sequesterRsrc --keepParent "$APP_IN_PATH" "$APP_ZIP_PATH" || {
echo "Error: Failed to zip application" >/dev/stderr
exit 1
}
xcrun notarytool submit \
"$APP_ZIP_PATH" \
--keychain-profile pop-pixie \
--wait || {
echo "Error: Failed to notarize application" >/dev/stderr
exit 1
}
rm -rf "$APP_OUT_PATH" &>/dev/null
cp -r "$APP_IN_PATH" "$APP_OUT_PATH" || {
echo "Error: Failed to copy application"
exit 1
}
hdiutil create -srcfolder "$PUBLIC_DIR" -volname "Install Pop Pixie" "$DMG_PATH"