-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathNotarizeMacOSPackages.sh
More file actions
executable file
·44 lines (38 loc) · 1.3 KB
/
NotarizeMacOSPackages.sh
File metadata and controls
executable file
·44 lines (38 loc) · 1.3 KB
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
APP_NAME="PixelViewer"
APP_BUNDLE_ID="com.carina-studio.pixelviewer"
RID_LIST=("osx-x64" "osx-arm64")
PUB_PLATFORM_LIST=("osx-x64" "osx-arm64")
KEY_ID="" # App Store Connect API Key ID
USERNAME="" # Apple Developer ID
PASSWORD="" # Application specific password
TEAM_ID=""
echo "********** Start notarizing $APP_NAME **********"
# Get application version
VERSION=$(dotnet run PackagingTool.cs -- get-current-version $APP_NAME/$APP_NAME.csproj)
if [ "$?" != "0" ]; then
echo "Unable to get version of $APP_NAME"
exit
fi
INFORMATIONAL_VERSION=$(dotnet run PackagingTool.cs -- get-current-informational-version $APP_NAME/$APP_NAME.csproj)
if [ "$?" != "0" ]; then
echo "Unable to get informational version of $APP_NAME"
exit
fi
PACKAGE_VERSION=$VERSION
if [ ! -z "$INFORMATIONAL_VERSION" ]; then
PACKAGE_VERSION=$INFORMATIONAL_VERSION
fi
echo "Version: $VERSION ($PACKAGE_VERSION)"
# Notarize
for i in "${!RID_LIST[@]}"; do
RID=${RID_LIST[$i]}
PUB_PLATFORM=${PUB_PLATFORM_LIST[$i]}
echo " "
echo "[$PUB_PLATFORM ($RID)]"
echo " "
# notarize
xcrun notarytool submit "./Packages/$VERSION/$APP_NAME-$PACKAGE_VERSION-$PUB_PLATFORM.zip" --key-id "$KEY_ID" --apple-id "$USERNAME" --password "$PASSWORD" --team-id "$TEAM_ID" --wait
if [ "$?" != "0" ]; then
exit
fi
done