mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-21 09:31:20 -08:00
133 lines
3.6 KiB
YAML
133 lines
3.6 KiB
YAML
# This workflow will build a Java project with Gradle
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
|
|
name: SlimeVR Server
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
create:
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: "17"
|
|
distribution: "adopt"
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
- name: Check code formatting
|
|
run: ./gradlew spotlessCheck
|
|
|
|
- name: Test with Gradle
|
|
run: ./gradlew test
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: "17"
|
|
distribution: "adopt"
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
- name: Build with Gradle
|
|
run: ./gradlew shadowJar
|
|
|
|
- name: Upload the Server JAR as a Build Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
# Artifact name
|
|
name: "SlimeVR-Server" # optional, default is artifact
|
|
# A file, directory or wildcard pattern that describes what to upload
|
|
path: server/build/libs/*
|
|
|
|
bundle:
|
|
runs-on: ubuntu-20.04
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: "SlimeVR-Server"
|
|
path: server/build/libs/
|
|
|
|
- name: Set up Linux dependencies
|
|
uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libfuse2
|
|
# Increment to invalidate the cache
|
|
version: 1.0
|
|
# 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
|
|
|
|
- name: Cache cargo dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: "tauri"
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.node-version'
|
|
cache: 'npm'
|
|
|
|
- name: Build
|
|
run: |
|
|
npm ci
|
|
npm run tauri build
|
|
|
|
- uses: actions/[email protected]
|
|
with:
|
|
name: SlimeVR-GUI-Deb
|
|
path: target/release/bundle/deb/slimevr*.deb
|
|
|
|
- name: Install appimage-builder
|
|
run: |
|
|
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
|
chmod a+x appimagetool-x86_64.AppImage
|
|
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
|
|
|
|
- name: Modify and Build AppImage
|
|
run: |
|
|
cd target/release/bundle/appimage
|
|
chmod a+x slimevr*.AppImage
|
|
./slimevr*.AppImage --appimage-extract
|
|
cp $( git rev-parse --show-toplevel )/server/build/libs/slimevr.jar squashfs-root/slimevr.jar
|
|
chmod 644 squashfs-root/slimevr.jar
|
|
appimagetool squashfs-root slimevr*.AppImage
|
|
|
|
- uses: actions/[email protected]
|
|
with:
|
|
name: SlimeVR-GUI-AppImage
|
|
path: target/release/bundle/appimage/slimevr*.AppImage
|