Repository navigation
52 lines (43 loc) · 1.62 KB
/
Copy pathrelease.yml
File metadata and controls
52 lines (43 loc) · 1.62 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
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: Package
shell: powershell
run: .\pack.ps1 -OutDir dist
- name: Publish the release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: gh release create $env:TAG "dist/xpp-lens-$env:VERSION.zip" --title "xpp-lens $env:VERSION" --notes-file dist/notes.md --verify-tag --latest