ci(release): multi-platform GitHub releases (win-x64 + osx-arm64) #13
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-test: | |
| name: Build & Test (.NET 10 · Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| # No packages.lock.json in the repo, so key the NuGet cache on the | |
| # project files + central package manifest instead of a lockfile. | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'Directory.Packages.props') }} | |
| restore-keys: | | |
| nuget-${{ runner.os }}- | |
| - name: Restore | |
| run: dotnet restore SwtorLogParser.slnx | |
| # Builds the full .slnx (core lib + CLI hosts + ImGui overlay + tests). net10.0 / | |
| # net10.0-windows; the overlay (SwtorLogParser.Overlay.ImGui) is a GLFW/OpenGL + | |
| # Dear ImGui window that requires the Windows runner (CsWin32 interop + win-x64 | |
| # native Silk/GLFW assets, resolved from NuGet — no `dotnet workload` step needed). | |
| - name: Build | |
| run: dotnet build SwtorLogParser.slnx -c Release --no-restore | |
| # A test failure exits non-zero -> the job (and run) fails: the regression gate. | |
| - name: Test | |
| run: >- | |
| dotnet test SwtorLogParser.Tests/SwtorLogParser.Tests.csproj | |
| -c Release --no-build | |
| --collect:"XPlat Code Coverage" | |
| --results-directory ${{ github.workspace }}/TestResults | |
| - name: Upload coverage | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: ${{ github.workspace }}/TestResults/**/coverage.cobertura.xml | |
| if-no-files-found: ignore | |
| # Non-blocking: validates the Native AOT publish of the CLI (incl. the MSVC link | |
| # step that cannot run on the dev machine). continue-on-error keeps a transient | |
| # AOT/link hiccup from failing the required build-test gate. | |
| aot-publish: | |
| name: Native AOT Publish (validation · non-blocking) | |
| runs-on: windows-latest | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| # SwtorLogParser.Cli is the AOT CLI (PublishAot=true); RID is supplied at publish time. | |
| - name: Publish Native AOT | |
| run: dotnet publish SwtorLogParser.Cli -c Release -r win-x64 | |
| - name: Upload native binary | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli | |
| path: SwtorLogParser.Cli/**/publish/SwtorLogParser.Cli.exe | |
| if-no-files-found: ignore |