name: release-binaries on: workflow_dispatch: inputs: publish_release: description: Publish the binaries as a GitHub release type: boolean default: true push: branches: - nx2 permissions: contents: read concurrency: group: release-binaries-${{ github.ref }} cancel-in-progress: true jobs: build: name: ${{ matrix.platform }} binary runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: include: - platform: linux-x86_64 runner: ubuntu-24.04 - platform: windows-x86_64 runner: windows-2022 steps: - name: Check out source uses: actions/checkout@v4 - name: Install Linux dependencies if: matrix.platform == 'linux-x86_64' shell: bash run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ autoconf cmake g++ gcc git glslang-tools libglu1-mesa-dev \ libpulse-dev libtool libudev-dev libxkbcommon-x11-0 \ mesa-common-dev nasm ninja-build qt6-base-private-dev \ qt6-charts-dev qt6-tools-dev libavfilter-dev libavcodec-dev \ libswscale-dev pkg-config zlib1g-dev libva-dev libvdpau-dev \ spirv-tools spirv-headers libusb-1.0-0-dev \ libboost-dev libboost-fiber-dev libboost-context-dev \ libopus-dev libasound2-dev - name: Install Qt on Linux if: matrix.platform == 'linux-x86_64' uses: jurplel/install-qt-action@v4 with: version: '6.8.3' host: linux target: desktop arch: linux_gcc_64 modules: qtcharts cache: true - name: Set up MSVC if: matrix.platform == 'windows-x86_64' uses: ilammy/msvc-dev-cmd@v1 - name: Install Qt on Windows if: matrix.platform == 'windows-x86_64' uses: jurplel/install-qt-action@v4 with: version: '6.8.3' host: windows target: desktop arch: win64_msvc2022_64 modules: qtcharts cache: true - name: Install Vulkan SDK on Windows if: matrix.platform == 'windows-x86_64' shell: pwsh run: ./tools/windows/install-vulkan-sdk.ps1 - name: Verify Vulkan tools on Windows if: matrix.platform == 'windows-x86_64' shell: pwsh run: glslangValidator --version - name: Cache CPM downloads uses: actions/cache@v4 with: path: .cache/cpm key: cpm-${{ runner.os }}-${{ hashFiles('cpmfile.json', 'CMakeLists.txt', 'src/**/CMakeLists.txt') }} restore-keys: | cpm-${{ runner.os }}- - name: Configure Linux if: matrix.platform == 'linux-x86_64' shell: bash run: >- cmake -S . -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DYUZU_TESTS=OFF -DYUZU_CMD=ON -DYUZU_ROOM=OFF -DYUZU_ROOM_STANDALONE=OFF -DYUZU_USE_BUNDLED_QT=OFF -DCMAKE_PREFIX_PATH="$QT_ROOT_DIR" -DYUZU_USE_BUNDLED_SDL3=ON -DVulkanHeaders_FORCE_BUNDLED=ON -DVulkanUtilityLibraries_FORCE_BUNDLED=ON -DENABLE_UPDATE_CHECKER=OFF -DUSE_DISCORD_PRESENCE=OFF - name: Configure Windows if: matrix.platform == 'windows-x86_64' shell: bash run: >- cmake -S . -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DYUZU_TESTS=OFF -DYUZU_CMD=ON -DYUZU_ROOM=OFF -DYUZU_ROOM_STANDALONE=OFF -DYUZU_USE_BUNDLED_QT=OFF -DYUZU_USE_BUNDLED_SDL3=ON -DENABLE_UPDATE_CHECKER=OFF -DUSE_DISCORD_PRESENCE=OFF - name: Build shell: bash run: cmake --build build/release --target yuzu yuzu-cmd --parallel - name: Package Linux binary if: matrix.platform == 'linux-x86_64' shell: bash run: | test -x build/release/bin/eglantine test -x build/release/bin/eden-cli tar -C build/release/bin -czf "eglantine-${GITHUB_SHA}-linux-x86_64.tar.gz" eglantine eden-cli - name: Package Windows binary if: matrix.platform == 'windows-x86_64' shell: pwsh run: | foreach ($exe in 'eglantine.exe', 'eden-cli.exe') { if (-not (Test-Path "build/release/bin/$exe")) { throw "build/release/bin/$exe was not produced" } } windeployqt --release --no-translations build/release/bin/eglantine.exe Compress-Archive -Path build/release/bin/* -DestinationPath "eglantine-${env:GITHUB_SHA}-windows-x86_64.zip" - name: Upload binary uses: actions/upload-artifact@v4 with: name: eglantine-${{ matrix.platform }}-${{ github.sha }} path: eglantine-${{ github.sha }}-${{ matrix.platform }}.* if-no-files-found: error compression-level: 0 retention-days: 7 # Publishes both binaries as a GitHub pre-release once every platform built: on pushes to nx2, # and on manual runs unless "Publish the binaries as a GitHub release" is unticked. release: name: Publish release needs: build if: github.event_name == 'push' || inputs.publish_release runs-on: ubuntu-24.04 permissions: contents: write steps: - name: Download binaries uses: actions/download-artifact@v4 with: pattern: eglantine-*-${{ github.sha }} path: dist merge-multiple: true - name: Create release shell: bash env: GH_TOKEN: ${{ github.token }} run: | ls -la dist gh release create "build-${GITHUB_RUN_NUMBER}" dist/* \ --repo "${GITHUB_REPOSITORY}" \ --target "${GITHUB_SHA}" \ --prerelease \ --title "Eglantine ${GITHUB_REF_NAME} build ${GITHUB_RUN_NUMBER} (${GITHUB_SHA::7})" \ --notes "Automatic build of ${GITHUB_REF_NAME} at ${GITHUB_SHA}. Windows: extract the zip and run eglantine.exe, or eden-cli.exe from a terminal. Linux: extract the tar.gz; it needs Qt 6.8 and the libraries Eglantine is built against installed on the system."