Release #209
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
| # SPDX-FileCopyrightText: 2021-2025 O21 contributors <https://github.com/ForNeVeR/O21> | |
| # | |
| # SPDX-License-Identifier: MIT | |
| # This file is auto-generated. | |
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: 0 0 * * 6 | |
| jobs: | |
| release: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-24.04 | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_NOLOGO: 1 | |
| NUGET_PACKAGES: ${{ github.workspace }}/.github/nuget-packages | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - id: version | |
| name: Read version from ref | |
| shell: pwsh | |
| run: echo "version=$(./Scripts/Get-Version.ps1 -RefName $env:GITHUB_REF)" >> $env:GITHUB_OUTPUT | |
| - name: Set up .NET SDK | |
| uses: actions/setup-dotnet@v5 | |
| - name: NuGet cache | |
| uses: actions/cache@v5 | |
| with: | |
| key: ${{ runner.os }}.nuget.${{ hashFiles('**/*.fsproj') }} | |
| path: ${{ env.NUGET_PACKAGES }} | |
| - name: Publish for Linux x86-64 | |
| shell: pwsh | |
| run: dotnet publish O21.Game --self-contained --runtime "linux-x64" --configuration Release --output "o21.linux.x86-64" && Set-Location "o21.linux.x86-64" && zip -r "../o21.v${{ steps.version.outputs.version }}.linux.x86-64.zip" * | |
| - name: Publish for macOS AArch64 | |
| shell: pwsh | |
| run: dotnet publish O21.Game --self-contained --runtime "osx-arm64" --configuration Release --output "o21.macos.aarch64" && Set-Location "o21.macos.aarch64" && zip -r "../o21.v${{ steps.version.outputs.version }}.macos.aarch64.zip" * | |
| - name: Publish for Windows x86-64 | |
| shell: pwsh | |
| run: dotnet publish O21.Game --self-contained --runtime "win-x64" --configuration Release --output "o21.windows.x86-64" && Set-Location "o21.windows.x86-64" && zip -r "../o21.v${{ steps.version.outputs.version }}.windows.x86-64.zip" * | |
| - id: changelog | |
| name: Read changelog | |
| uses: ForNeVeR/ChangelogAutomation.action@v2 | |
| with: | |
| output: ./release-notes.md | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| path: |- | |
| ./release-notes.md | |
| o21.v${{ steps.version.outputs.version }}.linux.x86-64.zip | |
| o21.v${{ steps.version.outputs.version }}.macos.aarch64.zip | |
| o21.v${{ steps.version.outputs.version }}.windows.x86-64.zip | |
| - if: startsWith(github.ref, 'refs/tags/v') | |
| id: release | |
| name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: ./release-notes.md | |
| name: O21 v${{ steps.version.outputs.version }} |