From b1076f7e95e7ab56b30cc4a3345e695d62b6af02 Mon Sep 17 00:00:00 2001 From: Hamster Date: Thu, 2 Feb 2023 17:26:27 +0800 Subject: [PATCH] Update build script. --- BuildLinuxPackages.bat | 5 ++++- BuildLinuxPackages.sh | 4 +++- BuildMacOSPackages.sh | 4 +++- NotarizeMacOSPackages.sh | 4 +++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/BuildLinuxPackages.bat b/BuildLinuxPackages.bat index a0ecda2..0b2a72b 100644 --- a/BuildLinuxPackages.bat +++ b/BuildLinuxPackages.bat @@ -4,6 +4,9 @@ set APP_NAME=PixelViewer set RID_LIST=linux-arm64 linux-x64 set CONFIG=Release set FRAMEWORK=net6.0 +set SELF_CONTAINED=true +set TRIM_ASSEMBLIES=true +set READY_TO_RUN=false set ERRORLEVEL=0 echo ********** Start building %APP_NAME% ********** @@ -69,7 +72,7 @@ REM Build packages ) REM Build project - dotnet publish %APP_NAME% -c %CONFIG% -r %%r --self-contained true -p:PublishTrimmed=true + dotnet publish %APP_NAME% -c %CONFIG% -r %%r --self-contained %SELF_CONTAINED% -p:PublishTrimmed=%TRIM_ASSEMBLIES% -p:PublishReadyToRun=%READY_TO_RUN% if %ERRORLEVEL% neq 0 ( echo Failed to build project: %ERRORLEVEL% del /Q Packages\Packaging.txt diff --git a/BuildLinuxPackages.sh b/BuildLinuxPackages.sh index 173dfbf..1d88edf 100755 --- a/BuildLinuxPackages.sh +++ b/BuildLinuxPackages.sh @@ -1,6 +1,8 @@ APP_NAME="PixelViewer" RID_LIST=("linux-x64" "linux-arm64") CONFIG="Release" +TRIM_ASSEMBLIES="true" +READY_TO_RUN="false" echo "********** Start building $APP_NAME **********" @@ -45,7 +47,7 @@ for i in "${!RID_LIST[@]}"; do fi # build - dotnet publish $APP_NAME -c $CONFIG -r $RID --self-contained true -p:PublishTrimmed=true + dotnet publish $APP_NAME -c $CONFIG -r $RID --self-contained true -p:PublishTrimmed=$TRIM_ASSEMBLIES -p:PublishReadyToRun=$READY_TO_RUN if [ "$?" != "0" ]; then exit fi diff --git a/BuildMacOSPackages.sh b/BuildMacOSPackages.sh index a634d29..66477d0 100755 --- a/BuildMacOSPackages.sh +++ b/BuildMacOSPackages.sh @@ -2,6 +2,8 @@ APP_NAME="PixelViewer" RID_LIST=("osx-x64" "osx.11.0-arm64") PUB_PLATFORM_LIST=("osx-x64" "osx-arm64") CONFIG="Release" +TRIM_ASSEMBLIES="true" +READY_TO_RUN="false" CERT_NAME="" # Name of certification to sign the application echo "********** Start building $APP_NAME **********" @@ -41,7 +43,7 @@ for i in "${!RID_LIST[@]}"; do fi # build - dotnet msbuild $APP_NAME -t:BundleApp -property:Configuration=$CONFIG -p:SelfContained=true -p:PublishSingleFile=false -p:PublishTrimmed=true -p:RuntimeIdentifier=$RID + dotnet msbuild $APP_NAME -t:BundleApp -property:Configuration=$CONFIG -p:SelfContained=true -p:PublishSingleFile=false -p:PublishTrimmed=$TRIM_ASSEMBLIES -p:RuntimeIdentifier=$RID -p:PublishReadyToRun=$READY_TO_RUN if [ "$?" != "0" ]; then exit fi diff --git a/NotarizeMacOSPackages.sh b/NotarizeMacOSPackages.sh index 83b4002..39d8503 100755 --- a/NotarizeMacOSPackages.sh +++ b/NotarizeMacOSPackages.sh @@ -2,8 +2,10 @@ APP_NAME="PixelViewer" APP_BUNDLE_ID="com.carina-studio.ulogviewer" RID_LIST=("osx-x64" "osx.11.0-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 **********" @@ -25,7 +27,7 @@ for i in "${!RID_LIST[@]}"; do echo " " # notarize - xcrun altool --notarize-app -f "./Packages/$VERSION/$APP_NAME-$VERSION-$PUB_PLATFORM.zip" --primary-bundle-id "$APP_BUNDLE_ID" -u "$USERNAME" -p "$PASSWORD" + xcrun notarytool submit "./Packages/$VERSION/$APP_NAME-$VERSION-$PUB_PLATFORM.zip" --key-id "$KEY_ID" --apple-id "$USERNAME" --password "$PASSWORD" --team-id "$TEAM_ID" if [ "$?" != "0" ]; then exit fi