-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (85 loc) · 3.37 KB
/
release.yml
File metadata and controls
100 lines (85 loc) · 3.37 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Extract version from tag
id: version
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag.TrimStart('v')
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
- name: Restore dependencies
run: |
dotnet restore src/WindowSeat.App/WindowSeat.App.csproj
dotnet restore src/WindowSeat.Tests/WindowSeat.Tests.csproj
- name: Build (Release)
run: |
dotnet build src/WindowSeat.App/WindowSeat.App.csproj --configuration Release --no-restore /p:Version=${{ steps.version.outputs.VERSION }}
dotnet build src/WindowSeat.Tests/WindowSeat.Tests.csproj --configuration Release --no-restore
- name: Run tests
run: >
dotnet test src/WindowSeat.Tests/WindowSeat.Tests.csproj
--configuration Release
--no-build
--verbosity normal
- name: Publish app
run: >
dotnet publish src/WindowSeat.App/WindowSeat.App.csproj
--configuration Release
--runtime win-x64
--self-contained false
--output publish/
/p:Version=${{ steps.version.outputs.VERSION }}
# ── ZIP (GitHub Releases sideload) ────────────────────────────────────
- name: Package zip
shell: pwsh
run: |
Compress-Archive -Path publish/* -DestinationPath "WindowSeat-${{ steps.version.outputs.VERSION }}-win-x64.zip"
# ── MSIX (Microsoft Store submission) ─────────────────────────────────
- name: Patch manifest version
shell: pwsh
run: |
$v = "${{ steps.version.outputs.VERSION }}.0"
$path = "packaging/WindowSeat.Package/Package.appxmanifest"
(Get-Content $path -Raw) `
-replace '(?<=<Identity[^>]*Version=")[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', $v |
Set-Content $path
Write-Host "Manifest version set to $v"
- name: Build MSIX package
shell: pwsh
run: |
msbuild packaging/WindowSeat.Package/WindowSeat.Package.wapproj `
/p:Configuration=Release `
/p:Platform=x64 `
/p:AppxPackageSigningEnabled=false `
/p:AppxAutoIncrementPackageRevision=false `
/p:GenerateTestArtifacts=false `
"/p:AppxPackageDir=${{ github.workspace }}\artifacts\msix\\"
- name: Upload MSIX (Store submission artifact)
uses: actions/upload-artifact@v4
with:
name: WindowSeat-${{ steps.version.outputs.VERSION }}-store-package
path: artifacts/msix/*.msix
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: WindowSeat ${{ github.ref_name }}
draft: true
generate_release_notes: true
files: |
WindowSeat-${{ steps.version.outputs.VERSION }}-win-x64.zip