-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-macos-release.sh
executable file
·62 lines (47 loc) · 1.63 KB
/
build-macos-release.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
#!/bin/bash
# $HOME/Qt/$QT_VER/macos/bin/lupdate qml src -ts langs/fr.ts
set -e # exit immeditalley on error
QT_VER=6.7.3
APP_NAME=FiscalRecords
APP_IDENTIFIER="com.cristeab.fiscalrecords"
MAJOR_VERSION=1.1
MINOR_VERSION=$(git rev-list --count HEAD)
APP_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}"
DEVELOPER_ID="Bogdan Cristea"
DEVELOPER_USERNAME="cristeab@gmail.com"
TEAM_ID="FAARUB626Q"
PKG_NAME=${APP_NAME}-${APP_VERSION}.pkg
BUILD_DIR=build
echo "QT version $QT_VER"
rm -rf $BUILD_DIR
mkdir $BUILD_DIR
cmake -B $BUILD_DIR -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$HOME/Qt/$QT_VER/macos
cmake --build $BUILD_DIR -j
echo "Sign app bundle"
codesign --strict --timestamp --force --verify --verbose --deep \
--entitlements ./Entitlements.plist \
--sign "Developer ID Application: $DEVELOPER_ID" \
--options runtime ./build/$APP_NAME.app
# check the signing
codesign --verify --verbose=4 --deep --strict ./build/$APP_NAME.app
echo "Create installer"
cmake --build $BUILD_DIR --target package
echo "Signing installer package..."
productsign --sign "Developer ID Installer: $DEVELOPER_ID" \
$BUILD_DIR/$PKG_NAME \
$PKG_NAME
mv ${PKG_NAME} $BUILD_DIR/
if [ -z "$APP_PWD" ]; then
echo Notarization password is not set
exit 0
fi
echo "Upload installer to Apple servers"
xcrun notarytool submit $BUILD_DIR/$PKG_NAME \
--apple-id $DEVELOPER_USERNAME \
--team-id $TEAM_ID \
--password $APP_PWD \
--verbose \
--wait
# once the notarization is successful
echo "Staple the installer"
xcrun stapler staple -v $BUILD_DIR/$PKG_NAME