forked from kiding/SokIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·79 lines (68 loc) · 2.13 KB
/
deploy.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -Eeuxo pipefail
APP_PATH="${1:?}"
PASSWORD="${2:?}"
rm -rfv /tmp/SokIM
mkdir /tmp/SokIM
pushd /tmp/SokIM
mkdir scripts
pushd scripts
cat > preinstall <<< '#!/bin/sh
killall KeyboardSettings keyboardservicesd TextInputMenuAgent TextInputSwitcher imklaunchagent SokIM || true
sleep 3
killall KeyboardSettings keyboardservicesd TextInputMenuAgent TextInputSwitcher imklaunchagent SokIM || true'
chmod +x preinstall
popd
mkdir -p 'ROOT/Library/Input Methods/'
pushd 'ROOT/Library/Input Methods/'
cp -rfv "$APP_PATH" .
popd
pkgbuild \
--root ROOT \
--scripts scripts \
--identifier com.kiding.inputmethod.sok \
SokIM_component.pkg
cat > Distribution.xml <<< '<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>속 입력기</title>
<pkg-ref id="com.kiding.inputmethod.sok"/>
<options customize="never" require-scripts="false" hostArchitectures="x86_64,arm64"/>
<volume-check>
<allowed-os-versions>
<os-version min="13.0"/>
</allowed-os-versions>
</volume-check>
<choices-outline>
<line choice="default">
<line choice="com.kiding.inputmethod.sok"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.kiding.inputmethod.sok" visible="false">
<pkg-ref id="com.kiding.inputmethod.sok"/>
</choice>
<pkg-ref id="com.kiding.inputmethod.sok" version="0" onConclusion="RequireLogout">SokIM_component.pkg</pkg-ref>
</installer-gui-script>'
productbuild \
--distribution Distribution.xml \
--package-path . \
SokIM_unsigned.pkg
productsign \
--sign 'Developer ID Installer: Dong Sung Kim (MHKL47BD47)' \
SokIM_unsigned.pkg \
SokIM.pkg
SUBMISSION_ID="$(xcrun notarytool submit \
SokIM.pkg \
--apple-id '[email protected]' \
--password "$PASSWORD" \
--team-id 'MHKL47BD47' \
| awk '/id: / {print $2; exit 0;}' || true)"
xcrun notarytool wait \
"$SUBMISSION_ID" \
--apple-id '[email protected]' \
--password "$PASSWORD" \
--team-id 'MHKL47BD47'
stapler staple SokIM.pkg
stapler validate SokIM.pkg
open .
popd