Release Suite #29
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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-release: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| name: linux-x64 | |
| artifact: eapps-linux-x64 | |
| - os: windows-latest | |
| name: windows-x64 | |
| artifact: eapps-windows-x64 | |
| - os: macos-latest | |
| name: macos-arm64 | |
| artifact: eapps-macos-arm64 | |
| name: Build (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libsdl2-dev | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install sdl2 | |
| - name: Configure (Unix) | |
| if: runner.os != 'Windows' | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=Release | |
| - name: Configure (Windows) | |
| if: runner.os == 'Windows' | |
| run: cmake -B build | |
| - name: Build | |
| run: cmake --build build --config Release --parallel | |
| - name: Test | |
| run: | | |
| cmake -B build-test -DBUILD_TESTING=ON | |
| cmake --build build-test --config Release --parallel | |
| ctest --test-dir build-test --output-on-failure -C Release | |
| - name: Package (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| mkdir -p dist | |
| cp build/apps/suite/eapps_suite dist/ 2>/dev/null || true | |
| tar czf ${{ matrix.artifact }}.tar.gz -C dist . | |
| - name: Package (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| mkdir -p dist | |
| cp build/apps/suite/eapps_suite dist/ 2>/dev/null || true | |
| tar czf ${{ matrix.artifact }}.tar.gz -C dist . | |
| - name: Package (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| New-Item -ItemType Directory -Force -Path dist | |
| Copy-Item build\Release\*.exe dist\ -ErrorAction SilentlyContinue | |
| Copy-Item build\apps\suite\Release\*.exe dist\ -ErrorAction SilentlyContinue | |
| Compress-Archive -Path dist\* -DestinationPath ${{ matrix.artifact }}.zip | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: | | |
| *.tar.gz | |
| *.zip | |
| create-release: | |
| name: Create GitHub Release | |
| needs: build-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: release-artifacts | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: release-artifacts/**/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |