apply release tag and auto generate release notes #15
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
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Build and Release | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| arch: [x64, x86, ARM64] | |
| runs-on: windows-latest # For a list of available runner types, refer to | |
| # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
| env: | |
| Solution_Name: SummaSQLGame.sln # Replace with your solution name, i.e. MyWpfApp.sln. | |
| Test_Project_Path: SummaSQLGame\SummaSQLGameTests\SummaSQLGameTests.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Install the .NET Core workload | |
| - name: Install .NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
| - name: Setup MSBuild.exe | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Setup NuGet | |
| uses: NuGet/setup-nuget@v2 | |
| # Execute all unit tests in the solution | |
| - name: Execute unit tests | |
| run: dotnet test -v q | |
| - name: Build solutions | |
| run: msbuild D:\a\SQLGame\SQLGame\SummaSQLGame\SummaSQLGame.csproj /p:Configuration=Release /p:Platform=${{ matrix.arch }} | |
| - name: Create artifact folder | |
| run: | | |
| mkdir output | |
| xcopy /s /y /i "D:\a\SQLGame\SQLGame\SummaSQLGame\bin\${{ matrix.arch }}\Release" "output\${{ matrix.arch }}" | |
| - name: Zip build output | |
| run: | | |
| powershell Compress-Archive -Path "output\${{ matrix.arch }}\*" -DestinationPath "${{ github.workspace }}\${{ matrix.arch }}.zip" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-${{ matrix.arch }} | |
| path: ${{ github.workspace }}/${{ matrix.arch }}.zip | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Auto Generate Next Release Tag | |
| # You may pin to the exact commit or the version. | |
| # uses: amitsingh-007/next-release-tag@43666cc7d412293e514756c2796dcba08c678369 | |
| id: generate_release_tag | |
| uses: amitsingh-007/next-release-tag@v6.3.0 | |
| with: | |
| # Github secrets token | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # Prefix added to the generated release tag; supports an optional * wildcard only at the end for prefix matching | |
| tag_prefix: 'v-*' | |
| tag_template: 'yyyy.mm.dd.i' | |
| previous_tag: 'v-2025.09.15.1' | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Release ${{ steps.generate_release_tag.outputs.next_release_tag }} | |
| tag_name: ${{ steps.generate_release_tag.outputs.next_release_tag }} | |
| generate_release_notes: true | |
| files: | | |
| artifacts/build-x64/*.zip | |
| artifacts/build-x86/*.zip | |
| artifacts/build-ARM64/*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |