-
Notifications
You must be signed in to change notification settings - Fork 0
/
sign_and_publish.sh
executable file
·32 lines (24 loc) · 1.16 KB
/
sign_and_publish.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
#!/bin/bash
# Application name
APP="new_mac_desktop"
# Application path
APP_PATH="./build/macos/Build/Products/Release/$APP.app"
# Unsigned package path
PKG_PATH_UNSIGNED="./build/macos/Build/Products/Release/$APP-unsigned.pkg"
# Signed package path
PKG_PATH="./build/macos/Build/Products/Release/$APP.pkg"
# Code signing certificates
DEV_CERT="3rd Party Mac Developer Application: NEVERCODE LTD (X8NNQ9CYL2)"
INSTALLER_CERT="3rd Party Mac Developer Installer: NEVERCODE LTD (X8NNQ9CYL2)"
FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"
cp macos/Runner/Release.entitlements entitlements.plist
for file in $(ls $FRAMEWORKS_PATH)
do
codesign -s "$DEV_CERT" -f --entitlements entitlements.plist $FRAMEWORKS_PATH/$file
done;
codesign -s "$DEV_CERT" -f --entitlements entitlements.plist "$APP_PATH/Contents/MacOS/$APP"
codesign -s "$DEV_CERT" -f --entitlements entitlements.plist "$APP_PATH"
set -ex
xcrun productbuild --component $APP_PATH /Applications/ $PKG_PATH_UNSIGNED
xcrun productsign --keychain "$(keychain get-default)" --sign "$INSTALLER_CERT" $PKG_PATH_UNSIGNED $PKG_PATH
xcrun altool --upload-app --file $PKG_PATH --type osx --username $APPLE_ID --password $APPLE_PASSWORD