Skip to content

Commit

Permalink
Add an argument for the runtime identifier to use for dotnet publish
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronwhite committed Dec 31, 2024
1 parent 87cd688 commit 6b466be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }}
run: |
cd installer/macos
./build_installer.sh
./build_installer.sh osx-x64
- name: Upload Installer
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }}
run: |
cd installer/macos
./build_installer.sh
./build_installer.sh osx-arm64
- name: Upload Installer
if: github.event_name != 'pull_request'
Expand Down
11 changes: 10 additions & 1 deletion installer/macos/build_installer.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/sh
set -e

# Parse command line arguments
runtimeid=$1

if [ "$runtimeid" != "osx-x64" ] && [ "$runtimeid" != "osx-arm64" ]; then
echo "Invalid runtime identifier (should be osx-x64 or osx-arm64)"
echo "Usage: ./build_installer.sh runtimeid"
exit 1
fi

MAC_APP_DIR="$PWD/package/Pinta.app"
MAC_APP_BIN_DIR="${MAC_APP_DIR}/Contents/MacOS/"
MAC_APP_RESOURCE_DIR="${MAC_APP_DIR}/Contents/Resources/"
Expand All @@ -15,7 +24,7 @@ run_codesign()

mkdir -p ${MAC_APP_BIN_DIR} ${MAC_APP_RESOURCE_DIR} ${MAC_APP_SHARE_DIR}

dotnet publish ../../Pinta.sln -p:PublishDir=${MAC_APP_BIN_DIR} -p:BuildTranslations=true -c Release -r osx-x64 --self-contained true
dotnet publish ../../Pinta.sln -p:PublishDir=${MAC_APP_BIN_DIR} -p:BuildTranslations=true -c Release -r $runtimeid --self-contained true

# Remove stuff we don't need.
rm ${MAC_APP_BIN_DIR}/*.pdb
Expand Down

0 comments on commit 6b466be

Please sign in to comment.