-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.6 KB
/
Copy pathrelease.yml
File metadata and controls
53 lines (45 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
}