Skip to content

Commit 69547f5

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. Make localnet cache OS-specific Prevent Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run Add a warning about `linux/aarch64` tests being skipped Simplify GitHub Actions workflow conditions Replace verbose condition syntax with simpler `runner.os` expressions to improve readability and maintainability. This change: - Uses `runner.os` instead of specific `matrix.os` version strings - Removes unnecessary `${{ }}` expression wrappers in if conditions - Consolidates OS-specific conditions (e.g. `ubuntu-22.04` or `ubuntu-22.04-arm`) into simpler checks (`runner.os == 'Linux'`) Fix JavaFX loading on Mac ARM64 architecture JavaFX 21.0.2 supports Mac ARM64 (Apple Silicon) but was failing to load with `UnsatisfiedLinkError` because the build system wasn't detecting ARM architecture properly. This change allows the build system to correctly identify Mac ARM64 systems and use the appropriate JavaFX libraries, resolving the compatibility issues when running on Apple Silicon Macs. Split Build and Package Installer steps Cleaner CI output, split Build and Package installer step into two steps
1 parent fe3283f commit 69547f5

File tree

3 files changed

+102
-44
lines changed

3 files changed

+102
-44
lines changed

.github/workflows/build.yml

Lines changed: 96 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,25 @@ 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-15, windows-latest]
18+
include:
19+
- os: ubuntu-22.04
20+
arch: x86_64
21+
skip_tests: false
22+
- os: ubuntu-22.04-arm
23+
arch: aarch64
24+
# JavaFX 21.x.x doesn't support `linux/aarch64`
25+
# So skip tests until JavaFX is updated
26+
skip_tests: true
27+
- os: macos-13
28+
arch: x86_64
29+
skip_tests: false
30+
- os: macos-15
31+
arch: aarch64
32+
skip_tests: false
33+
- os: windows-latest
34+
arch: x86_64
35+
skip_tests: false
1836
fail-fast: false
1937
runs-on: ${{ matrix.os }}
2038
steps:
@@ -27,8 +45,16 @@ jobs:
2745
java-version: '21'
2846
distribution: 'adopt'
2947
cache: gradle
30-
- name: Build with Gradle
48+
- name: Build with Gradle with tests
49+
if: matrix.skip_tests == false
3150
run: ./gradlew build --stacktrace --scan
51+
- name: Build with Gradle without tests
52+
if: matrix.skip_tests == true
53+
run: |
54+
./gradlew build --stacktrace --scan -x test
55+
echo "::warning title=Tests Skipped::Tests were intentionally skipped for linux/aarch64 builds \
56+
as JavaFX 21.x.x doesn't currently support the linux/aarch64 architecture. \
57+
This should be revisited when JavaFX is next updated."
3258
- uses: actions/upload-artifact@v4
3359
if: failure()
3460
with:
@@ -38,130 +64,158 @@ jobs:
3864
uses: actions/upload-artifact@v4
3965
with:
4066
include-hidden-files: true
41-
name: cached-localnet
67+
name: cached-localnet-${{ matrix.os }}
4268
path: .localnet
4369
overwrite: true
4470
- name: Install dependencies
45-
if: ${{ matrix.os == 'ubuntu-22.04' }}
71+
if: runner.os == 'Linux'
4672
run: |
4773
sudo apt-get update
4874
sudo apt-get install -y rpm libfuse2 flatpak flatpak-builder appstream
4975
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
5076
- name: Install WiX Toolset
51-
if: ${{ matrix.os == 'windows-latest' }}
77+
if: runner.os == 'Windows'
5278
run: |
5379
Invoke-WebRequest -Uri 'https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe' -OutFile wix314.exe
5480
.\wix314.exe /quiet /norestart
5581
shell: powershell
56-
- name: Build Haveno Installer
82+
- name: Build Haveno Installer with tests
83+
if: matrix.skip_tests == false
84+
run: ./gradlew clean build --refresh-keys --refresh-dependencies
85+
working-directory: .
86+
- name: Build Haveno Installer without tests
87+
if: matrix.skip_tests == true
5788
run: |
58-
./gradlew clean build --refresh-keys --refresh-dependencies
59-
./gradlew packageInstallers
89+
./gradlew clean build --refresh-keys --refresh-dependencies -x test
90+
echo "::warning title=Tests Skipped::Tests were intentionally skipped for linux/aarch64 builds \
91+
as JavaFX 21.x.x doesn't currently support the linux/aarch64 architecture. \
92+
This should be revisited when JavaFX is next updated."
93+
working-directory: .
94+
- name: Package Haveno Installer
95+
run: ./gradlew packageInstallers
6096
working-directory: .
6197

6298
# get version from jar
6399
- name: Set Version Unix
64-
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13' }}
100+
if: runner.os != 'Windows'
65101
run: |
66102
export VERSION=$(ls desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 | grep -Eo 'desktop-[0-9]+\.[0-9]+\.[0-9]+' | sed 's/desktop-//')
67103
echo "VERSION=$VERSION" >> $GITHUB_ENV
68104
- name: Set Version Windows
69-
if: ${{ matrix.os == 'windows-latest' }}
105+
if: runner.os == 'Windows'
70106
run: |
71107
$VERSION = (Get-ChildItem -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256).Name -replace 'desktop-', '' -replace '-.*', ''
72108
"VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
73109
shell: powershell
74110

75111
- name: Move Release Files for Linux
76-
if: ${{ matrix.os == 'ubuntu-22.04' }}
112+
if: runner.os == 'Linux'
77113
run: |
78114
mkdir ${{ github.workspace }}/release-linux-rpm
79115
mkdir ${{ github.workspace }}/release-linux-deb
80116
mkdir ${{ github.workspace }}/release-linux-flatpak
81117
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
118+
mv desktop/build/temp-*/binaries/haveno-*.rpm ${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}-installer.rpm
119+
mv desktop/build/temp-*/binaries/haveno_*.deb ${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}-installer.deb
120+
mv desktop/build/temp-*/binaries/*.flatpak ${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}.flatpak
121+
mv desktop/build/temp-*/binaries/haveno_*.AppImage ${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}.AppImage
86122
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-deb
87123
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-rpm
88124
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-appimage
89125
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
126+
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/haveno-v${{ env.VERSION }}-linux-${{ matrix.arch }}-SNAPSHOT-all.jar.SHA-256
91127
shell: bash
92128
- name: Move Release Files for macOS
93-
if: ${{ matrix.os == 'macos-13' }}
129+
if: runner.os == 'MacOS'
94130
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
131+
mkdir ${{ github.workspace }}/release-macos-${{ matrix.arch }}
132+
mv desktop/build/temp-*/binaries/Haveno-*.dmg ${{ github.workspace }}/release-macos-${{ matrix.arch }}/haveno-v${{ env.VERSION }}-macos-${{ matrix.arch }}-installer.dmg
133+
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-macos-${{ matrix.arch }}
134+
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-${{ matrix.arch }}-SNAPSHOT-all.jar.SHA-256
99135
shell: bash
100136
- name: Move Release Files on Windows
101-
if: ${{ matrix.os == 'windows-latest' }}
137+
if: runner.os == 'Windows'
102138
run: |
103139
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
140+
Move-Item -Path desktop\build\temp-*/binaries\Haveno-*.exe -Destination ${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-${{ matrix.arch }}-installer.exe
105141
Copy-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/release-windows
106142
Move-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/haveno-v${{ env.VERSION }}-windows-SNAPSHOT-all.jar.SHA-256
107143
shell: powershell
108144

109-
# win
145+
# Windows artifacts
110146
- uses: actions/upload-artifact@v4
111147
name: "Windows artifacts"
112-
if: ${{ matrix.os == 'windows-latest' }}
148+
if: runner.os == 'Windows'
113149
with:
114-
name: haveno-windows
150+
name: haveno-windows-${{ matrix.arch }}
115151
path: ${{ github.workspace }}/release-windows
116-
# macos
152+
153+
# macOS artifacts
117154
- uses: actions/upload-artifact@v4
118155
name: "macOS artifacts"
119-
if: ${{ matrix.os == 'macos-13' }}
156+
if: runner.os == 'MacOS'
120157
with:
121-
name: haveno-macos
122-
path: ${{ github.workspace }}/release-macos
123-
# linux
158+
name: haveno-macos-${{ matrix.arch }}
159+
path: ${{ github.workspace }}/release-macos-${{ matrix.arch }}
160+
161+
# Linux artifacts
124162
- uses: actions/upload-artifact@v4
125163
name: "Linux - deb artifact"
126-
if: ${{ matrix.os == 'ubuntu-22.04' }}
164+
if: runner.os == 'Linux'
127165
with:
128-
name: haveno-linux-deb
166+
name: haveno-linux-${{ matrix.arch }}-deb
129167
path: ${{ github.workspace }}/release-linux-deb
130168

131169
- uses: actions/upload-artifact@v4
132170
name: "Linux - rpm artifact"
133-
if: ${{ matrix.os == 'ubuntu-22.04' }}
171+
if: runner.os == 'Linux'
134172
with:
135-
name: haveno-linux-rpm
173+
name: haveno-linux-${{ matrix.arch }}-rpm
136174
path: ${{ github.workspace }}/release-linux-rpm
137175

138176
- uses: actions/upload-artifact@v4
139177
name: "Linux - AppImage artifact"
140-
if: ${{ matrix.os == 'ubuntu-22.04' }}
178+
if: runner.os == 'Linux'
141179
with:
142-
name: haveno-linux-appimage
180+
name: haveno-linux-${{ matrix.arch }}-appimage
143181
path: ${{ github.workspace }}/release-linux-appimage
144182

145183
- uses: actions/upload-artifact@v4
146184
name: "Linux - flatpak artifact"
147-
if: ${{ matrix.os == 'ubuntu-22.04' }}
185+
if: runner.os == 'Linux'
148186
with:
149-
name: haveno-linux-flatpak
187+
name: haveno-linux-${{ matrix.arch }}-flatpak
150188
path: ${{ github.workspace }}/release-linux-flatpak
151189

152190
- name: Release
153191
uses: softprops/action-gh-release@v2
154192
if: startsWith(github.ref, 'refs/tags/')
155193
with:
156194
files: |
195+
# Linux x86_64
157196
${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-x86_64-installer.deb
158197
${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-x86_64-installer.rpm
159198
${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-x86_64.AppImage
160199
${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-x86_64.flatpak
161200
${{ 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
201+
202+
# Linux aarch64
203+
${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-aarch64-installer.deb
204+
${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-aarch64-installer.rpm
205+
${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-aarch64.AppImage
206+
${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-aarch64.flatpak
207+
${{ github.workspace }}/haveno-v${{ env.VERSION }}-linux-aarch64-SNAPSHOT-all.jar.SHA-256
208+
209+
# macOS x86_64
210+
${{ github.workspace }}/release-macos-x86_64/haveno-v${{ env.VERSION }}-macos-x86_64-installer.dmg
211+
${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-x86_64-SNAPSHOT-all.jar.SHA-256
212+
213+
# macOS aarch64
214+
${{ github.workspace }}/release-macos-aarch64/haveno-v${{ env.VERSION }}-macos-aarch64-installer.dmg
215+
${{ github.workspace }}/haveno-v${{ env.VERSION }}-macos-aarch64-SNAPSHOT-all.jar.SHA-256
216+
217+
# Windows
218+
${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-x86_64-installer.exe
165219
${{ github.workspace }}/haveno-v${{ env.VERSION }}-windows-SNAPSHOT-all.jar.SHA-256
166220
167221
# https://git-scm.com/docs/git-tag - git-tag Docu

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ configure(subprojects) {
7979
slf4jVersion = '1.7.30'
8080
sparkVersion = '2.5.2'
8181

82-
os = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os
82+
def osName = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os
83+
def osArch = System.getProperty("os.arch").toLowerCase()
84+
os = (osName == 'mac' && (osArch.contains('aarch64') || osArch.contains('arm'))) ? 'mac-aarch64' : osName
8385
}
8486

8587
repositories {
@@ -951,4 +953,3 @@ configure(project(':apitest')) {
951953
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$jupiterVersion"
952954
}
953955
}
954-

gradle/verification-metadata.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,6 +2474,9 @@
24742474
<artifact name="javafx-swing-21.0.2-linux.jar">
24752475
<sha256 value="67a4369cd556ed9b8b6970116e5f5f7f55ef64e54aaddbcc3f7950f7590631b5" origin="Generated by Gradle"/>
24762476
</artifact>
2477+
<artifact name="javafx-swing-21.0.2-mac-aarch64.jar">
2478+
<sha256 value="5e6b5f10350915d92e2df8d602646eccf9b7f62c56fe04849a6b6f647d50fb74" origin="Generated by Gradle"/>
2479+
</artifact>
24772480
<artifact name="javafx-swing-21.0.2-mac.jar">
24782481
<sha256 value="2f047f7a4e5bc8e9603c23b168b472590a0a0607ba16b6c62d5f9b4f361d12ad" origin="Generated by Gradle"/>
24792482
</artifact>

0 commit comments

Comments
 (0)