-
Notifications
You must be signed in to change notification settings - Fork 281
/
Copy pathpackage
executable file
·57 lines (50 loc) · 1.54 KB
/
package
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
#!/bin/zsh -Ndefgku
#
# script/package
# mas
#
# Builds .pkg installer.
#
. "${0:a:h}/_setup_script"
script/build "${1:-}" --arch arm64 --arch x86_64
build_dir=.build
destination_root="${build_dir}/destination"
version="$(script/version)"
printf $'==> 📦 Assembling installer package for mas %s\n' "${version}"
ditto -v "${build_dir}/apple/Products/Release/mas" "${destination_root}/mas"
pkgbuild \
--identifier com.mphys.mas-cli \
--install-location /usr/local/bin \
--version "${version}" \
--root "${destination_root}" \
"${build_dir}/mas_components.pkg"
# shellcheck disable=SC1036
productbuild \
--distribution =(cat <<'END'
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<installer-gui-script minSpecVersion="2">
<pkg-ref id="com.mphys.mas-cli">
<bundle-version/>
</pkg-ref>
<pkg-ref id="com.mphys.mas-cli" onConclusion="none">#mas_components.pkg</pkg-ref>
<domains enable_localSystem="true" enable_anywhere="true" enable_currentUserHome="false"/>
<options customize="never" require-scripts="false"/>
<volume-check>
<allowed-os-versions>
<os-version min="10.15"/>
</allowed-os-versions>
</volume-check>
<choices-outline>
<line choice="default">
<line choice="com.mphys.mas-cli"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.mphys.mas-cli" visible="false">
<pkg-ref id="com.mphys.mas-cli"/>
</choice>
</installer-gui-script>
END
) \
--package-path "${build_dir}" \
"${build_dir}/mas-${version}.pkg"