Repository navigation
60 lines (50 loc) · 2.01 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (50 loc) · 2.01 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
54
55
56
57
58
59
60
name: Release
# Pushing a tag vX.Y.Z publishes the release: tests, package, notes from CHANGELOG.md.
# The tag must match <Version> in src/XppLens/XppLens.csproj; release tags cannot be moved afterwards.
on:
push:
tags: ['v*']
permissions:
contents: read
jobs:
release:
name: release
runs-on: windows-latest
timeout-minutes: 30
permissions:
contents: write
env:
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
DOTNET_NOLOGO: '1'
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 9.0.x
- name: Check that the tag matches the project version
shell: pwsh
run: |
$version = ([xml](Get-Content src/XppLens/XppLens.csproj -Raw)).Project.PropertyGroup.Version | Where-Object { $_ } | Select-Object -First 1
if ("v$version" -ne $env:TAG) { throw "tag $env:TAG does not match <Version>$version</Version> in src/XppLens/XppLens.csproj" }
"VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Test
run: dotnet test xpp-lens.sln -c Release
- name: Release notes
shell: powershell
run: .\release-notes.ps1 -Version $env:VERSION -OutFile dist\notes.md
- name: Inno Setup
shell: pwsh
run: ./.github/install-inno.ps1
- name: Package and setup program
shell: powershell
run: .\pack.ps1 -OutDir dist -Installer
# vX.Y.Z-beta.N is a test release: marked as pre-release, never "Latest", so 'xpplens update' does not offer it
# ('xpplens update --pre' does).
- name: Publish the release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$kind = if ($env:TAG -match '-') { '--prerelease' } else { '--latest' }
gh release create $env:TAG "dist/xpp-lens-$env:VERSION.zip" "dist/xpp-lens-setup-$env:VERSION.exe" --title "xpp-lens $env:VERSION" --notes-file dist/notes.md --verify-tag $kind