-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (49 loc) · 1.66 KB
/
Copy pathrelease.yml
File metadata and controls
58 lines (49 loc) · 1.66 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
publish-release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up .NET
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
- name: Validate release version
shell: pwsh
run: |
[xml]$project = Get-Content .\src\CodexUsageWidget\CodexUsageWidget.csproj
$version = $project.Project.PropertyGroup.Version
if ($env:GITHUB_REF_NAME -ne "v$version") {
throw "Tag $env:GITHUB_REF_NAME does not match project version v$version."
}
- name: Build and test portable release
shell: pwsh
run: .\scripts\publish.ps1 -Runtime win-x64
- name: Create SHA-256 checksum
shell: pwsh
run: |
$archive = '.\artifacts\release\codex-usage-widget-win-x64.zip'
$checksum = (Get-FileHash -LiteralPath $archive -Algorithm SHA256).Hash.ToLowerInvariant()
"$checksum codex-usage-widget-win-x64.zip" |
Set-Content -LiteralPath "$archive.sha256" -Encoding ascii
- name: Publish GitHub release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create $env:GITHUB_REF_NAME `
.\artifacts\release\codex-usage-widget-win-x64.zip `
.\artifacts\release\codex-usage-widget-win-x64.zip.sha256 `
--verify-tag `
--generate-notes `
--title "Codex Usage Widget $env:GITHUB_REF_NAME"