Switch to Electron #7646
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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@v6 | |
| with: | |
| submodules: recursive | |
| - name: Get tags | |
| run: git fetch --tags origin --recurse-submodules=no --force | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - run: mkdir -p ./gui/out/renderer && touch ./gui/out/renderer/somefile | |
| shell: bash | |
| - name: Check code formatting | |
| run: ./gradlew spotlessCheck | |
| - name: Test with Gradle | |
| run: ./gradlew test | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Get tags | |
| run: git fetch --tags origin --recurse-submodules=no --force | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Build with Gradle | |
| run: ./gradlew :server:desktop:shadowJar | |
| - name: Upload the Server JAR as a Build Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| # Artifact name | |
| 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 | |
| - name: Upload to draft release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| server/desktop/build/libs/slimevr.jar | |
| bundle-android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Get tags | |
| run: git fetch --tags origin --recurse-submodules=no --force | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm i | |
| - name: Build GUI | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| run: cd gui && pnpm run build | |
| - name: Build with Gradle | |
| run: ./gradlew :server:android:build | |
| env: | |
| ANDROID_STORE_FILE: ${{ secrets.ANDROID_STORE_FILE }} | |
| ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_STORE_PASSWD }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_KEY_PASSWD }} | |
| - name: Upload the Android build artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| # Artifact name | |
| name: 'SlimeVR-Android' # optional, default is artifact | |
| # A file, directory or wildcard pattern that describes what to upload | |
| path: server/android/build/outputs/apk/* | |
| - name: Prepare for release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| cp server/android/build/outputs/apk/release/android-release.apk ./SlimeVR-android.apk | |
| - name: Upload to draft release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| ./SlimeVR-android.apk | |
| - name: Build Google Play release bundle | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: ./gradlew :server:android:bundleRelease | |
| env: | |
| ANDROID_STORE_FILE: ${{ secrets.ANDROID_GPLAY_STORE_FILE }} | |
| ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_GPLAY_STORE_PASSWD }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_GPLAY_KEY_ALIAS }} | |
| ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_GPLAY_KEY_PASSWD }} | |
| - name: Upload the Google Play artifact | |
| uses: actions/upload-artifact@v6 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| # Artifact name | |
| name: 'SlimeVR-Android-GPDev' # optional, default is artifact | |
| # A file, directory or wildcard pattern that describes what to upload | |
| path: server/android/build/outputs/bundle/release/* | |
| bundle-linux: | |
| 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@v6 | |
| with: | |
| submodules: recursive | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: 'SlimeVR-Server' | |
| path: server/desktop/build/libs/ | |
| - name: Set up Linux dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@v1.6.0 | |
| with: | |
| packages: | | |
| build-essential curl wget file libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev xdg-utils patchelf | |
| # Increment to invalidate the cache | |
| version: ${{ format('v2.0-electron-{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 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm i | |
| - name: Build | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| run: | | |
| cd gui | |
| pnpm run build | |
| pnpm exec electron-builder --linux --publish never | |
| - name: Make GUI tarball | |
| run: | | |
| tar czf slimevr-gui-dist.tar.gz -C gui/out/renderer/ . | |
| - uses: actions/upload-artifact@v6 | |
| if: matrix.os == 'ubuntu-latest' | |
| with: | |
| name: SlimeVR-GUI-Dist | |
| path: ./slimevr-gui-dist.tar.gz | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ format('SlimeVR-GUI-Deb-{0}', env.BUILD_ARCH) }} | |
| path: gui/dist/artifacts/*.deb | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ format('SlimeVR-GUI-AppImage-{0}', env.BUILD_ARCH) }} | |
| path: gui/dist/artifacts/*.AppImage | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ format('SlimeVR-GUI-RPM-{0}', env.BUILD_ARCH) }} | |
| path: gui/dist/artifacts/*.rpm | |
| - name: Prepare for release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| cp gui/dist/artifacts/*.AppImage "./SlimeVR-$BUILD_ARCH.appimage" | |
| cp gui/dist/artifacts/*.deb "./SlimeVR-$BUILD_ARCH.deb" | |
| cp gui/dist/artifacts/*.rpm "./SlimeVR-$BUILD_ARCH.rpm" | |
| - name: Upload to draft release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| ./slimevr-gui-dist.tar.gz | |
| ./SlimeVR-*.appimage | |
| ./SlimeVR-*.deb | |
| ./SlimeVR-*.rpm | |
| bundle-mac: | |
| runs-on: macos-latest | |
| needs: [build, test] | |
| # if: contains(fromJSON('["workflow_dispatch", "create"]'), github.event_name) | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: 'SlimeVR-Server' | |
| path: server/desktop/build/libs/ | |
| - uses: pnpm/action-setup@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: | | |
| pnpm i | |
| - name: Build | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| run: | | |
| cd gui | |
| pnpm run build | |
| pnpm exec electron-builder --mac --universal --publish never | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: SlimeVR-GUI-MacDmg | |
| path: gui/dist/artifacts/*.dmg | |
| - name: Prepare for release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| cp gui/dist/artifacts/*.dmg ./SlimeVR-mac.dmg | |
| - name: Upload to draft release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| ./SlimeVR-mac.dmg | |
| bundle-windows: | |
| 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@v6 | |
| with: | |
| submodules: recursive | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: 'SlimeVR-Server' | |
| path: server/desktop/build/libs/ | |
| - uses: pnpm/action-setup@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| shell: bash | |
| run: pnpm i | |
| - name: Build | |
| shell: bash | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| run: | | |
| cd gui | |
| pnpm run build | |
| pnpm exec electron-builder --win portable --publish never | |
| - name: Bundle to zips | |
| shell: bash | |
| run: | | |
| mkdir SlimeVR | |
| cp gui/dist/artifacts/*.exe ./SlimeVR/slimevr.exe | |
| cp gui/electron/ressources/icons/icon.ico ./SlimeVR/run.ico | |
| cp server/desktop/build/libs/slimevr.jar ./SlimeVR/slimevr.jar | |
| cp server/core/resources/* ./SlimeVR/ | |
| 7z a -tzip "SlimeVR-$BUILD_ARCH.zip" ./SlimeVR/ | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ format('SlimeVR-GUI-Windows-{0}', env.BUILD_ARCH) }} | |
| path: ./SlimeVR*.zip | |
| - name: Upload to draft release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: ./SlimeVR-*.zip |