Add ARM builds in CI (#1482)

This commit is contained in:
Uriel
2025-07-03 01:28:05 +02:00
committed by GitHub
parent 7874bbca27
commit 3ec6a61763
5 changed files with 180 additions and 618 deletions

View File

@@ -42,35 +42,46 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
os:
[
ubuntu-22.04,
windows-latest,
macos-latest,
ubuntu-22.04-arm,
windows-11-arm,
]
runs-on: ${{ matrix.os }}
env:
# Don't mark warnings as errors
CI: false
BUILD_ARCH: ${{ endsWith(matrix.os, 'arm') && 'aarch64' || 'amd64' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- if: matrix.os == 'ubuntu-22.04'
- if: startsWith(matrix.os, 'ubuntu')
name: Set up Linux dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.5.0
with:
packages: libgtk-3-dev webkit2gtk-4.1 libappindicator3-dev librsvg2-dev patchelf
# Increment to invalidate the cache
version: 1.0
version: ${{ format('v1.0-{0}', env.BUILD_ARCH) }}
# Enables a workaround to attempt to run pre and post install scripts
execute_install_scripts: true
# Disables uploading logs as a build artifact
debug: false
- if: matrix.os == 'windows-11-arm'
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ matrix.os }}"
- uses: pnpm/action-setup@v4
- name: Use Node.js
@@ -90,21 +101,21 @@ jobs:
NODE_OPTIONS: ${{ matrix.os == 'macos-latest' && '--max-old-space-size=4096' || '' }}
run: pnpm run skipbundler --config $( ./gui/scripts/gitversion.mjs )
- if: matrix.os == 'windows-latest'
- if: startsWith(matrix.os, 'windows')
name: Upload a Build Artifact (Windows)
uses: actions/upload-artifact@v4
with:
# Artifact name
name: SlimeVR-GUI-Windows
name: ${{ format('SlimeVR-GUI-Windows-{0}', env.BUILD_ARCH) }}
# A file, directory or wildcard pattern that describes what to upload
path: target/release/slimevr.exe
- if: matrix.os == 'ubuntu-22.04'
- if: startsWith(matrix.os, 'ubuntu')
name: Upload a Build Artifact (Linux)
uses: actions/upload-artifact@v4
with:
# Artifact name
name: SlimeVR-GUI-Linux
name: ${{ format('SlimeVR-GUI-Linux-{0}', env.BUILD_ARCH) }}
# A file, directory or wildcard pattern that describes what to upload
path: target/release/slimevr

View File

@@ -29,8 +29,8 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
@@ -44,7 +44,6 @@ jobs:
- name: Test with Gradle
run: ./gradlew test
build:
runs-on: ubuntu-latest
@@ -59,8 +58,8 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
@@ -72,7 +71,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
# Artifact name
name: "SlimeVR-Server" # optional, default is artifact
name: 'SlimeVR-Server' # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: server/desktop/build/libs/slimevr.jar
@@ -85,7 +84,6 @@ jobs:
files: |
server/desktop/build/libs/slimevr.jar
bundle-android:
runs-on: ubuntu-latest
steps:
@@ -99,8 +97,8 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
@@ -127,7 +125,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
# Artifact name
name: "SlimeVR-Android" # optional, default is artifact
name: 'SlimeVR-Android' # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: server/android/build/outputs/apk/*
@@ -145,11 +143,16 @@ jobs:
files: |
./SlimeVR-android.apk
bundle-linux:
runs-on: ubuntu-24.04
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
needs: [build, test]
if: contains(fromJSON('["workflow_dispatch", "create"]'), github.event_name)
env:
BUILD_ARCH: ${{ endsWith(matrix.os, 'arm') && 'aarch64' || 'amd64' }}
steps:
- uses: actions/checkout@v4
with:
@@ -157,7 +160,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: "SlimeVR-Server"
name: 'SlimeVR-Server'
path: server/desktop/build/libs/
- name: Set up Linux dependencies
@@ -166,7 +169,7 @@ jobs:
packages: |
build-essential curl wget file libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev
# Increment to invalidate the cache
version: 2.0
version: ${{ format('v1.0-{0}', env.BUILD_ARCH) }}
# Enables a workaround to attempt to run pre and post install scripts
execute_install_scripts: true
# Disables uploading logs as a build artifact
@@ -184,8 +187,6 @@ jobs:
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "ubuntu-22.04"
- uses: pnpm/action-setup@v4
- name: Use Node.js
@@ -207,31 +208,32 @@ jobs:
tar czf slimevr-gui-dist.tar.gz -C gui/dist/ .
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: SlimeVR-GUI-Dist
path: ./slimevr-gui-dist.tar.gz
- uses: actions/upload-artifact@v4
with:
name: SlimeVR-GUI-Deb
name: ${{ format('SlimeVR-GUI-Deb-{0}', env.BUILD_ARCH) }}
path: target/release/bundle/deb/slimevr*.deb
- uses: actions/upload-artifact@v4
with:
name: SlimeVR-GUI-AppImage
name: ${{ format('SlimeVR-GUI-AppImage-{0}', env.BUILD_ARCH) }}
path: target/release/bundle/appimage/slimevr*.AppImage
- uses: actions/upload-artifact@v4
with:
name: SlimeVR-GUI-RPM
path: target/release/bundle/rpm/slimevr*.rpm
name: ${{ format('SlimeVR-GUI-RPM-{0}', env.BUILD_ARCH) }}
path: target/release/bundle/rpm/slimevr*.rpm
- name: Prepare for release
if: startsWith(github.ref, 'refs/tags/')
run: |
cp target/release/bundle/appimage/slimevr*.AppImage ./SlimeVR-amd64.appimage
cp target/release/bundle/deb/slimevr*.deb ./SlimeVR-amd64.deb
cp target/release/bundle/rpm/slimevr*.rpm ./SlimeVR-amd64.rpm
cp target/release/bundle/appimage/slimevr*.AppImage "./SlimeVR-$BUILD_ARCH.appimage"
cp target/release/bundle/deb/slimevr*.deb "./SlimeVR-$BUILD_ARCH.deb"
cp target/release/bundle/rpm/slimevr*.rpm "./SlimeVR-$BUILD_ARCH.rpm"
- name: Upload to draft release
uses: softprops/action-gh-release@v2
@@ -241,10 +243,9 @@ jobs:
generate_release_notes: true
files: |
./slimevr-gui-dist.tar.gz
./SlimeVR-amd64.appimage
./SlimeVR-amd64.deb
./SlimeVR-amd64.rpm
./SlimeVR-*.appimage
./SlimeVR-*.deb
./SlimeVR-*.rpm
bundle-mac:
runs-on: macos-latest
@@ -257,13 +258,11 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: "SlimeVR-Server"
name: 'SlimeVR-Server'
path: server/desktop/build/libs/
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "macos-latest"
- uses: pnpm/action-setup@v4
- name: Use Node.js
@@ -322,11 +321,16 @@ jobs:
files: |
./SlimeVR-mac.dmg
bundle-windows:
runs-on: windows-latest
strategy:
matrix:
os: [windows-latest, windows-11-arm]
runs-on: ${{ matrix.os }}
needs: [build, test]
if: contains(fromJSON('["workflow_dispatch", "create"]'), github.event_name)
env:
BUILD_ARCH: ${{ endsWith(matrix.os, 'arm') && 'win-aarch64' || 'win64' }}
steps:
- uses: actions/checkout@v4
with:
@@ -334,13 +338,16 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: "SlimeVR-Server"
name: 'SlimeVR-Server'
path: server/desktop/build/libs/
- if: matrix.os == 'windows-11-arm'
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "windows-latest"
- uses: pnpm/action-setup@v4
- name: Use Node.js
@@ -367,11 +374,11 @@ jobs:
cp server/desktop/build/libs/slimevr.jar ./SlimeVR/slimevr.jar
cp server/core/resources/* ./SlimeVR/
cp target/release/slimevr.exe ./SlimeVR/
7z a -tzip SlimeVR-win64.zip ./SlimeVR/
7z a -tzip "SlimeVR-$BUILD_ARCH.zip" ./SlimeVR/
- uses: actions/upload-artifact@v4
with:
name: SlimeVR-GUI-Windows
name: ${{ format('SlimeVR-GUI-Windows-{0}', env.BUILD_ARCH) }}
path: ./SlimeVR*.zip
- name: Upload to draft release
@@ -380,4 +387,4 @@ jobs:
with:
draft: true
generate_release_notes: true
files: ./SlimeVR-win64.zip
files: ./SlimeVR-*.zip