Skip to content

Commit a317990

Browse files
committed
Add aarch64 architecture support to CI
Extend CI workflow to build for both `x86_64` and `aarch64` architectures: - Add ARM variants for Ubuntu and macOS in the build matrix - Skip tests on `aarch64` builds with `-x test` flag as JavaFX 21.x.x doesn't currently support the ARM64 architecture - Update artifact naming to include architecture identifiers - Configure architecture-specific build paths and release outputs This change enables native builds for ARM-based systems like Apple Silicon Macs and ARM servers, improving performance for users on these platforms while maintaining full test coverage on `x86_64` where supported.
1 parent fe3283f commit a317990

File tree

1 file changed

+75
-35
lines changed

1 file changed

+75
-35
lines changed

.github/workflows/build.yml

Lines changed: 75 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ jobs:
1414
build:
1515
strategy:
1616
matrix:
17-
os: [ubuntu-22.04, macos-13, windows-latest]
17+
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-13, macos-14, windows-latest]
18+
include:
19+
- os: ubuntu-22.04
20+
arch: x86_64
21+
- os: ubuntu-22.04-arm
22+
arch: aarch64
23+
- os: macos-13
24+
arch: x86_64
25+
- os: macos-14
26+
arch: aarch64
27+
- os: windows-latest
28+
arch: x86_64
1829
fail-fast: false
1930
runs-on: ${{ matrix.os }}
2031
steps:
@@ -27,8 +38,12 @@ jobs:
2738
java-version: '21'
2839
distribution: 'adopt'
2940
cache: gradle
30-
- name: Build with Gradle
41+
- name: Build with Gradle with tests
42+
if: ${{ matrix.arch == 'x86_64' }}
3143
run: ./gradlew build --stacktrace --scan
44+
- name: Build with Gradle without tests
45+
if: ${{ matrix.arch == 'aarch64' }}
46+
run: ./gradlew build --stacktrace --scan -x test
3247
- uses: actions/upload-artifact@v4
3348
if: failure()
3449
with:
@@ -42,7 +57,7 @@ jobs:
4257
path: .localnet
4358
overwrite: true
4459
- name: Install dependencies
45-
if: ${{ matrix.os == 'ubuntu-22.04' }}
60+
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm' }}
4661
run: |
4762
sudo apt-get update
4863
sudo apt-get install -y rpm libfuse2 flatpak flatpak-builder appstream
@@ -53,15 +68,22 @@ jobs:
5368
Invoke-WebRequest -Uri 'https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe' -OutFile wix314.exe
5469
.\wix314.exe /quiet /norestart
5570
shell: powershell
56-
- name: Build Haveno Installer
71+
- name: Build Haveno Installer with tests
72+
if: ${{ matrix.arch == 'x86_64' }}
5773
run: |
5874
./gradlew clean build --refresh-keys --refresh-dependencies
5975
./gradlew packageInstallers
6076
working-directory: .
77+
- name: Build Haveno Installer without tests
78+
if: ${{ matrix.arch == 'aarch64' }}
79+
run: |
80+
./gradlew clean build --refresh-keys --refresh-dependencies -x test
81+
./gradlew packageInstallers
82+
working-directory: .
6183

6284
# get version from jar
6385
- name: Set Version Unix
64-
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13' }}
86+
if: ${{ matrix.os != 'windows-latest' }}
6587
run: |
6688
export VERSION=$(ls desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 | grep -Eo 'desktop-[0-9]+\.[0-9]+\.[0-9]+' | sed 's/desktop-//')
6789
echo "VERSION=$VERSION" >> $GITHUB_ENV
@@ -73,95 +95,113 @@ jobs:
7395
shell: powershell
7496

7597
- name: Move Release Files for Linux
76-
if: ${{ matrix.os == 'ubuntu-22.04' }}
98+
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm' }}
7799
run: |
78100
mkdir ${{ github.workspace }}/release-linux-rpm
79101
mkdir ${{ github.workspace }}/release-linux-deb
80102
mkdir ${{ github.workspace }}/release-linux-flatpak
81103
mkdir ${{ github.workspace }}/release-linux-appimage
82-
mv desktop/build/temp-*/binaries/haveno-*.rpm ${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-x86_64-installer.rpm
83-
mv desktop/build/temp-*/binaries/haveno_*.deb ${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-x86_64-installer.deb
84-
mv desktop/build/temp-*/binaries/*.flatpak ${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-x86_64.flatpak
85-
mv desktop/build/temp-*/binaries/haveno_*.AppImage ${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-x86_64.AppImage
104+
mv desktop/build/temp-*/binaries/haveno-*.rpm ${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}-installer.rpm
105+
mv desktop/build/temp-*/binaries/haveno_*.deb ${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}-installer.deb
106+
mv desktop/build/temp-*/binaries/*.flatpak ${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}.flatpak
107+
mv desktop/build/temp-*/binaries/haveno_*.AppImage ${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}.AppImage
86108
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-deb
87109
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-rpm
88110
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-appimage
89111
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-flatpak
90-
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/haveno-v${{ env.VERSION }}-linux-x86_64-SNAPSHOT-all.jar.SHA-256
112+
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}-SNAPSHOT-all.jar.SHA-256
91113
shell: bash
92114
- name: Move Release Files for macOS
93-
if: ${{ matrix.os == 'macos-13' }}
115+
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }}
94116
run: |
95-
mkdir ${{ github.workspace }}/release-macos
96-
mv desktop/build/temp-*/binaries/Haveno-*.dmg ${{ github.workspace }}/release-macos/haveno-v${{ env.VERSION }}-macos-installer.dmg
97-
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-macos
98-
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-SNAPSHOT-all.jar.SHA-256
117+
mkdir ${{ github.workspace }}/release-macos-${{ matrix.arch }}
118+
mv desktop/build/temp-*/binaries/Haveno-*.dmg ${{ github.workspace }}/release-macos-${{ matrix.arch }}/haveno-v${{ env.VERSION }}-macos-${{ matrix.arch }}-installer.dmg
119+
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-macos-${{ matrix.arch }}
120+
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-${{ matrix.arch }}-SNAPSHOT-all.jar.SHA-256
99121
shell: bash
100122
- name: Move Release Files on Windows
101123
if: ${{ matrix.os == 'windows-latest' }}
102124
run: |
103125
mkdir ${{ github.workspace }}/release-windows
104-
Move-Item -Path desktop\build\temp-*/binaries\Haveno-*.exe -Destination ${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-installer.exe
126+
Move-Item -Path desktop\build\temp-*/binaries\Haveno-*.exe -Destination ${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-${{ matrix.arch }}-installer.exe
105127
Copy-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/release-windows
106128
Move-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/haveno-v${{ env.VERSION }}-windows-SNAPSHOT-all.jar.SHA-256
107129
shell: powershell
108130

109-
# win
131+
# Windows artifacts
110132
- uses: actions/upload-artifact@v4
111133
name: "Windows artifacts"
112134
if: ${{ matrix.os == 'windows-latest' }}
113135
with:
114-
name: haveno-windows
136+
name: haveno-windows-${{ matrix.arch }}
115137
path: ${{ github.workspace }}/release-windows
116-
# macos
138+
139+
# macOS artifacts
117140
- uses: actions/upload-artifact@v4
118141
name: "macOS artifacts"
119-
if: ${{ matrix.os == 'macos-13' }}
142+
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }}
120143
with:
121-
name: haveno-macos
122-
path: ${{ github.workspace }}/release-macos
123-
# linux
144+
name: haveno-macos-${{ matrix.arch }}
145+
path: ${{ github.workspace }}/release-macos-${{ matrix.arch }}
146+
147+
# Linux artifacts
124148
- uses: actions/upload-artifact@v4
125149
name: "Linux - deb artifact"
126-
if: ${{ matrix.os == 'ubuntu-22.04' }}
150+
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm' }}
127151
with:
128-
name: haveno-linux-deb
152+
name: haveno-linux-${{ matrix.arch }}-deb
129153
path: ${{ github.workspace }}/release-linux-deb
130154

131155
- uses: actions/upload-artifact@v4
132156
name: "Linux - rpm artifact"
133-
if: ${{ matrix.os == 'ubuntu-22.04' }}
157+
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm' }}
134158
with:
135-
name: haveno-linux-rpm
159+
name: haveno-linux-${{ matrix.arch }}-rpm
136160
path: ${{ github.workspace }}/release-linux-rpm
137161

138162
- uses: actions/upload-artifact@v4
139163
name: "Linux - AppImage artifact"
140-
if: ${{ matrix.os == 'ubuntu-22.04' }}
164+
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm' }}
141165
with:
142-
name: haveno-linux-appimage
166+
name: haveno-linux-${{ matrix.arch }}-appimage
143167
path: ${{ github.workspace }}/release-linux-appimage
144168

145169
- uses: actions/upload-artifact@v4
146170
name: "Linux - flatpak artifact"
147-
if: ${{ matrix.os == 'ubuntu-22.04' }}
171+
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm' }}
148172
with:
149-
name: haveno-linux-flatpak
173+
name: haveno-linux-${{ matrix.arch }}-flatpak
150174
path: ${{ github.workspace }}/release-linux-flatpak
151175

152176
- name: Release
153177
uses: softprops/action-gh-release@v2
154178
if: startsWith(github.ref, 'refs/tags/')
155179
with:
156180
files: |
181+
# Linux x86_64
157182
${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-x86_64-installer.deb
158183
${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-x86_64-installer.rpm
159184
${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-x86_64.AppImage
160185
${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-x86_64.flatpak
161186
${{ github.workspace }}/haveno-v${{ env.VERSION }}-linux-x86_64-SNAPSHOT-all.jar.SHA-256
162-
${{ github.workspace }}/release-macos/haveno-v${{ env.VERSION }}-macos-installer.dmg
163-
${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-SNAPSHOT-all.jar.SHA-256
164-
${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-installer.exe
187+
188+
# Linux aarch64
189+
${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-aarch64-installer.deb
190+
${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-aarch64-installer.rpm
191+
${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-aarch64.AppImage
192+
${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-aarch64.flatpak
193+
${{ github.workspace }}/haveno-v${{ env.VERSION }}-linux-aarch64-SNAPSHOT-all.jar.SHA-256
194+
195+
# macOS x86_64
196+
${{ github.workspace }}/release-macos-x86_64/haveno-v${{ env.VERSION }}-macos-x86_64-installer.dmg
197+
${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-x86_64-SNAPSHOT-all.jar.SHA-256
198+
199+
# macOS aarch64
200+
${{ github.workspace }}/release-macos-aarch64/haveno-v${{ env.VERSION }}-macos-aarch64-installer.dmg
201+
${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-aarch64-SNAPSHOT-all.jar.SHA-256
202+
203+
# Windows
204+
${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-x86_64-installer.exe
165205
${{ github.workspace }}/haveno-v${{ env.VERSION }}-windows-SNAPSHOT-all.jar.SHA-256
166206
167207
# https://git-scm.com/docs/git-tag - git-tag Docu

0 commit comments

Comments
 (0)