fix engine.pak location #100
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: Build & Latest Release (Linux + Windows) | |
| ####################################################################### | |
| # 1) Triggers | |
| ####################################################################### | |
| on: | |
| pull_request: | |
| branches: [ master ] # CI feedback on PRs | |
| push: | |
| branches: [ master ] # each commit to master → new “Latest” | |
| workflow_dispatch: # manual button | |
| ####################################################################### | |
| # 2) Permissions – required for creating / overwriting a release | |
| ####################################################################### | |
| permissions: | |
| contents: write | |
| ####################################################################### | |
| # 3) Build & test matrix (runs for PRs *and* pushes) | |
| ####################################################################### | |
| jobs: | |
| # ───────────────────────────────────────────────────────── build ── | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| # Linux leg | |
| - os: ubuntu-22.04 | |
| cfg: linux-release | |
| build: linux-build | |
| isLinux: true | |
| # Windows leg | |
| - os: windows-2022 | |
| cfg: windows-release | |
| build: windows-build | |
| isLinux: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| # 3-1) Checkout sources | |
| - uses: actions/checkout@v4 | |
| # 3-2) OS-specific dependencies | |
| - name: Install packages (apt) | |
| if: matrix.isLinux | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y --no-install-recommends \ | |
| clang ninja-build cmake build-essential \ | |
| libxmu-dev libxi-dev libxinerama-dev libxrandr-dev \ | |
| libxcursor-dev libudev-dev libopenal-dev unixodbc-dev \ | |
| libgl1-mesa-dev libxxf86vm-dev zlib1g-dev | |
| - name: Set up MSVC env | |
| if: matrix.os == 'windows-2022' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: { arch: x64 } | |
| - name: Verify Ninja is on PATH | |
| run: ninja --version | |
| # 3-3) Unpack engine artifacts (if needed) | |
| - name: Unzip Engine files (Linux) | |
| if: matrix.isLinux | |
| run: | | |
| unzip -q assets/Engine.zip -d assets | |
| unzip -q third_party/EE/Engine.zip -d third_party/EE | |
| - name: Unzip Engine files (Windows) | |
| if: matrix.os == 'windows-2022' | |
| shell: pwsh | |
| run: | | |
| Expand-Archive -Path assets/Engine.zip -DestinationPath assets -Force | |
| Get-ChildItem third_party/EE -Filter '*.zip' | | |
| ForEach-Object { Expand-Archive -Path $_.FullName -DestinationPath third_party/EE -Force } | |
| # 3-4) Configure → build → unit-test | |
| - name: Configure | |
| run: cmake --preset ${{ matrix.cfg }} | |
| - name: Build | |
| run: cmake --build --preset ${{ matrix.build }} | |
| - name: Run unit tests | |
| run: ctest --test-dir out/build/${{ matrix.cfg }} --output-on-failure | |
| # 3-5) Package runtime payload into out/dist | |
| - name: Package artifact (Linux) | |
| if: matrix.isLinux | |
| run: | | |
| STAGE=out/dist | |
| mkdir -p "$STAGE/Bin" | |
| cp "out/build/${{ matrix.cfg }}/apps/client/client" "$STAGE/client" | |
| cp "out/build/${{ matrix.cfg }}/apps/server/server" "$STAGE/server" | |
| cp assets/Engine.pak "$STAGE/Bin/Engine.pak" | |
| cp "out/build/${{ matrix.cfg }}/Bin/Project.pak" "$STAGE/Bin/Project.pak" | |
| - name: Package artifact (Windows) | |
| if: matrix.os == 'windows-2022' | |
| shell: pwsh | |
| run: | | |
| $Stage = "out/dist" | |
| New-Item -ItemType Directory -Force -Path "$Stage/Bin" | Out-Null | |
| Copy-Item "out/build/${{ matrix.cfg }}/apps/client/client.exe" "$Stage/client.exe" | |
| Copy-Item "out/build/${{ matrix.cfg }}/apps/server/server.exe" "$Stage/server.exe" | |
| Copy-Item "assets/Engine.pak" "$Stage/Bin/Engine.pak" | |
| Copy-Item "out/build/${{ matrix.cfg }}/Bin/Project.pak" "$Stage/Bin/Project.pak" | |
| # 3-6) Upload artifact (GitHub auto-zips out/dist) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: BasicAppCmake-${{ matrix.os }} # one zip per platform | |
| path: out/dist | |
| retention-days: 2 | |
| ####################################################################### | |
| # 4) Rolling “Latest” release (only on pushes to master) | |
| ####################################################################### | |
| release: | |
| needs: build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 4-1) Checkout (required by the release action) | |
| - uses: actions/checkout@v4 | |
| # 4-2) Download all build artifacts | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: BasicAppCmake-* # both OS zips | |
| merge-multiple: true | |
| path: release # → release/*.zip | |
| # 4-3) Prepare metadata | |
| - name: Prepare metadata | |
| id: vars | |
| run: | | |
| echo "timestamp=$(date -u +'%Y-%m-%d %H:%M UTC')" >> $GITHUB_OUTPUT | |
| echo "short_sha=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT | |
| # 4-4) Overwrite the single “Latest” release | |
| - name: Publish rolling Latest | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: latest | |
| make_latest: true | |
| name: Latest build – ${{ steps.vars.outputs.timestamp }} | |
| body: | | |
| Automatic build from commit \ | |
| [`${{ steps.vars.outputs.short_sha }}`]\ | |
| (${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}). | |
| files: release/** |