feat: persistent change log of every applied setting #23
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: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'installer/**' | |
| - '.github/workflows/release.yml' | |
| tags: ['v*.*.*'] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version (e.g. 1.0.0). Leave blank to auto-bump from latest tag.' | |
| required: false | |
| default: '' | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Resolve version | |
| id: ver | |
| shell: pwsh | |
| run: | | |
| $manual = '${{ github.event.inputs.version }}' | |
| if ($env:GITHUB_REF -like 'refs/tags/v*') { | |
| $v = $env:GITHUB_REF -replace 'refs/tags/v','' | |
| $createTag = $false | |
| } elseif (-not [string]::IsNullOrWhiteSpace($manual)) { | |
| $v = $manual | |
| $createTag = $true | |
| } else { | |
| $latest = (git tag --list 'v*.*.*' --sort=-v:refname | Select-Object -First 1) | |
| if ([string]::IsNullOrWhiteSpace($latest)) { $latest = 'v0.0.0' } | |
| $parts = ($latest -replace '^v','').Split('.') | |
| $patch = [int]$parts[2] + 1 | |
| $v = "$($parts[0]).$($parts[1]).$patch" | |
| $createTag = $true | |
| } | |
| "version=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| "create_tag=$($createTag.ToString().ToLower())" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| Write-Host "Building version $v (create_tag=$createTag)" | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore | |
| run: dotnet restore GamerGuardian.sln | |
| - name: Publish (self-contained, single-file, win-x64) | |
| run: > | |
| dotnet publish src/GamerGuardian/GamerGuardian.csproj | |
| -c Release | |
| -r win-x64 | |
| --self-contained true | |
| -p:PublishSingleFile=true | |
| -p:IncludeNativeLibrariesForSelfExtract=true | |
| -p:EnableCompressionInSingleFile=true | |
| -p:Version=${{ steps.ver.outputs.version }} | |
| -p:AssemblyVersion=${{ steps.ver.outputs.version }}.0 | |
| -p:FileVersion=${{ steps.ver.outputs.version }}.0 | |
| -o publish | |
| - name: Install Inno Setup | |
| run: choco install innosetup --yes --no-progress | |
| - name: Build installer | |
| shell: pwsh | |
| run: | | |
| & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DAppVersion=${{ steps.ver.outputs.version }} installer\GamerGuardian.iss | |
| if ($LASTEXITCODE -ne 0) { throw "ISCC failed with exit code $LASTEXITCODE" } | |
| - name: List artifacts | |
| shell: pwsh | |
| run: | | |
| Get-ChildItem -Recurse installer\Output, publish | Select-Object FullName, Length | |
| - name: Upload installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GamerGuardian-Setup-${{ steps.ver.outputs.version }} | |
| path: installer/Output/GamerGuardian-Setup-${{ steps.ver.outputs.version }}.exe | |
| - name: Upload portable EXE artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GamerGuardian-${{ steps.ver.outputs.version }}-portable | |
| path: publish/GamerGuardian.exe | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.ver.outputs.version }} | |
| name: GamerGuardian ${{ steps.ver.outputs.version }} | |
| generate_release_notes: true | |
| target_commitish: ${{ github.sha }} | |
| files: | | |
| installer/Output/GamerGuardian-Setup-${{ steps.ver.outputs.version }}.exe | |
| publish/GamerGuardian.exe |