2
2
version=" $1 "
3
3
isRelease=" $2 "
4
4
if [ -z " $version " ]; then
5
- echo " Usage: $0 <version> <isRelease>"
6
- exit 1
5
+ echo " Usage: $0 <version> <isRelease>"
6
+ exit 1
7
7
fi
8
8
if [ -z " $isRelease " ]; then
9
- echo " Usage: $0 <version> <isRelease>"
10
- exit 1
9
+ echo " Usage: $0 <version> <isRelease>"
10
+ exit 1
11
11
fi
12
12
13
13
if [ " $isRelease " == " true" ]; then
14
- if [ -z " $APPLE_NOTARIZE_AUTH_KEY_P8_BASE64 " ]; then
15
- echo " Please set APPLE_NOTARIZE_AUTH_KEY_P8_BASE64"
16
- exit 1
17
- fi
18
- if [ -z " $APPLE_NOTARIZE_D " ]; then
19
- echo " Please set APPLE_NOTARIZE_D"
20
- exit 1
21
- fi
22
- if [ -z " $APPLE_NOTARIZE_I " ]; then
23
- echo " Please set APPLE_NOTARIZE_I"
24
- exit 1
25
- fi
14
+ if [ -z " $APPLE_NOTARIZE_AUTH_KEY_P8_BASE64 " ]; then
15
+ echo " Please set APPLE_NOTARIZE_AUTH_KEY_P8_BASE64"
16
+ exit 1
17
+ fi
18
+ if [ -z " $APPLE_NOTARIZE_D " ]; then
19
+ echo " Please set APPLE_NOTARIZE_D"
20
+ exit 1
21
+ fi
22
+ if [ -z " $APPLE_NOTARIZE_I " ]; then
23
+ echo " Please set APPLE_NOTARIZE_I"
24
+ exit 1
25
+ fi
26
26
fi
27
27
28
28
build_dir=" $( mktemp -d) "
@@ -35,15 +35,14 @@ pkgid="io.nais.device"
35
35
pkg_path=" ./naisdevice.pkg"
36
36
37
37
# Prepare notarization key
38
- base64 -d > AuthKey.p8 <<< " $APPLE_NOTARIZE_AUTH_KEY_P8_BASE64"
38
+ base64 -d > AuthKey.p8 <<< " $APPLE_NOTARIZE_AUTH_KEY_P8_BASE64"
39
39
40
40
# Build and sign app
41
41
mkdir -p " $app_dir /Contents/" {MacOS,Resources}
42
42
cp ./bin/macos-client/* " $build_dir /naisdevice.app/Contents/MacOS/"
43
- cp ./packaging/macos/jq-osx-amd64 " $build_dir /naisdevice.app/Contents/MacOS/jq"
44
43
cp ./packaging/macos/icons/naisdevice.icns " $build_dir /naisdevice.app/Contents/Resources/"
45
44
46
- sed " s/VERSIONSTRING/$version /" ./packaging/macos/Info.plist.tpl > " $build_dir /naisdevice.app/Contents/Info.plist"
45
+ sed " s/VERSIONSTRING/$version /" ./packaging/macos/Info.plist.tpl > " $build_dir /naisdevice.app/Contents/Info.plist"
47
46
48
47
codesign -s " $app_cert " -f -v --timestamp --deep --options runtime " $build_dir /naisdevice.app/Contents/MacOS/" *
49
48
codesign -s " $app_cert " -f -v --timestamp --deep --options runtime " $build_dir /naisdevice.app/Contents/Info.plist"
@@ -56,21 +55,21 @@ xattr -rc "$build_dir/pkgroot/$(basename "$app_dir")"
56
55
57
56
pkgbuild --analyze --root " $build_dir /pkgroot/" " $build_plist "
58
57
pkgbuild \
59
- --root " $build_dir /pkgroot/" \
60
- --component-plist " $build_plist " \
61
- --identifier " $pkgid " \
62
- --install-location " /Applications" \
63
- --scripts " $build_dir /scripts" \
64
- --version " $version " \
65
- --sign " $install_cert " \
66
- --ownership recommended \
67
- " $pkg_path "
58
+ --root " $build_dir /pkgroot/" \
59
+ --component-plist " $build_plist " \
60
+ --identifier " $pkgid " \
61
+ --install-location " /Applications" \
62
+ --scripts " $build_dir /scripts" \
63
+ --version " $version " \
64
+ --sign " $install_cert " \
65
+ --ownership recommended \
66
+ " $pkg_path "
68
67
69
68
if [ " $isRelease " == " true" ]; then
70
- xcrun notarytool submit " $pkg_path " \
71
- -k AuthKey.p8 \
72
- -d " $APPLE_NOTARIZE_D " \
73
- -i " $APPLE_NOTARIZE_I " \
74
- --wait
75
- xcrun stapler staple " $pkg_path "
69
+ xcrun notarytool submit " $pkg_path " \
70
+ -k AuthKey.p8 \
71
+ -d " $APPLE_NOTARIZE_D " \
72
+ -i " $APPLE_NOTARIZE_I " \
73
+ --wait
74
+ xcrun stapler staple " $pkg_path "
76
75
fi
0 commit comments