Skip to content

Commit 091b099

Browse files
committed
ci: Add separate macOS builds for ARM and Intel architectures
This commit updates the `build-desktop.yml` GitHub Actions workflow to generate two distinct macOS application packages: one for ARM (Apple Silicon) and one for Intel processors. This is achieved by adding a new entry to the build matrix and introducing an `arch` variable to differentiate the builds.
1 parent 5ba7524 commit 091b099

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.github/workflows/build-desktop.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,32 @@ jobs:
3131
- name: Checkout code
3232
uses: actions/checkout@v4
3333

34-
- name: Setup JDK 17
34+
- name: Setup ARM JDK (default)
35+
if: matrix.arch == 'arm'
3536
uses: actions/setup-java@v4
3637
with:
3738
distribution: 'temurin'
3839
java-version: '17'
3940

40-
- name: Grant execute permission for Gradlew
41-
if: runner.os != 'Windows'
41+
- name: Install Intel (x86_64) JDK manually
42+
if: matrix.arch == 'intel'
43+
run: |
44+
curl -L -o intel-jdk.tar.gz https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11+9/OpenJDK17U-jdk_x64_mac_hotspot_17.0.11_9.tar.gz
45+
mkdir -p $HOME/intel-jdk
46+
tar -xzf intel-jdk.tar.gz -C $HOME/intel-jdk --strip-components=1
47+
echo "JAVA_HOME=$HOME/intel-jdk" >> $GITHUB_ENV
48+
49+
- name: Make gradlew executable
4250
run: chmod +x gradlew
4351

4452
- name: Build native packages
4553
run: ./gradlew ${{ matrix.gradle_task }} packageUberJarForCurrentOS --stacktrace
4654

47-
- name: Check build output
48-
run: ls -R composeApp/build || true
49-
5055
- name: Upload artifact
5156
uses: actions/upload-artifact@v4
5257
with:
5358
name: build-${{ matrix.format }}
54-
path: |
55-
composeApp/build/compose/binaries/**/dmg/*
56-
# composeApp/build/compose/binaries/**/pkg/*
57-
composeApp/build/compose/binaries/**/deb/*
58-
composeApp/build/compose/binaries/**/msi/*
59-
# composeApp/build/compose/jars/*.jar
60-
# composeApp/build/compose/binaries/**/app/*
59+
path: composeApp/build/compose/binaries/**/*
6160

6261
release:
6362
name: Create GitHub Release
@@ -77,10 +76,10 @@ jobs:
7776
uses: softprops/action-gh-release@v2
7877
with:
7978
files: |
80-
artifacts/build-macos/**/*.dmg
81-
artifacts/build-macos/**/*.app
82-
artifacts/build-macos/**/*.pkg
83-
artifacts/build-macos/**/*.jar
79+
artifacts/build-macos-arm/**/*.dmg
80+
artifacts/build-macos-intel/**/*.dmg
81+
artifacts/build-macos-arm/**/*.pkg
82+
artifacts/build-macos-intel/**/*.pkg
8483
artifacts/build-windows/**/*.msi
8584
artifacts/build-windows/**/*.exe
8685
artifacts/build-windows/**/*.jar

0 commit comments

Comments
 (0)