Release #4
Workflow file for this run
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: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Build release archive | |
| id: build | |
| shell: pwsh | |
| run: | | |
| $archivePath = pwsh -File ./scripts/build-release.ps1 | |
| if (-not $archivePath) { | |
| throw "build-release.ps1 did not return an archive path" | |
| } | |
| "archive_path=$archivePath" >> $env:GITHUB_OUTPUT | |
| - name: Build release notes | |
| id: notes | |
| shell: pwsh | |
| run: | | |
| $version = $env:GITHUB_REF_NAME -replace '^v', '' | |
| $notesPath = Join-Path $env:RUNNER_TEMP ("steam-promo-watch-{0}-release-notes.md" -f $version) | |
| pwsh -File ./scripts/get-release-notes.ps1 -Version $version -OutputPath $notesPath | |
| "notes_path=$notesPath" >> $env:GITHUB_OUTPUT | |
| - name: Create or update GitHub release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: pwsh | |
| run: | | |
| $tag = $env:GITHUB_REF_NAME | |
| $archivePath = "${{ steps.build.outputs.archive_path }}" | |
| $notesPath = "${{ steps.notes.outputs.notes_path }}" | |
| gh release view $tag *> $null | |
| if ($LASTEXITCODE -eq 0) { | |
| gh release upload $tag $archivePath --clobber | |
| gh release edit $tag --title "Steam Promo Watch $tag" --notes-file $notesPath --latest | |
| } else { | |
| gh release create $tag $archivePath --title "Steam Promo Watch $tag" --notes-file $notesPath --latest | |
| } |