-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (68 loc) · 2.42 KB
/
Copy pathrelease.yml
File metadata and controls
85 lines (68 loc) · 2.42 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
name: Release Windows exe
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: npm ci
- name: Build Windows installer
run: npm run tauri build
- name: Generate release notes
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
git fetch --tags --force
$currentTag = $env:GITHUB_REF_NAME
$tags = git tag --sort=-creatordate
$previousTag = $tags | Where-Object { $_ -ne $currentTag } | Select-Object -First 1
if ($previousTag) {
$range = "$previousTag..$currentTag"
} else {
$range = $currentTag
}
$messages = git log $range --pretty=format:"%s"
function Section([string] $title, [string[]] $items) {
if (-not $items -or $items.Count -eq 0) {
return @()
}
return @("### $title") + ($items | ForEach-Object { "- $_" }) + @("")
}
$features = $messages | Where-Object { $_ -match '^(feat|feature)(\(.+\))?:' }
$fixes = $messages | Where-Object { $_ -match '^fix(\(.+\))?:' }
$performance = $messages | Where-Object { $_ -match '^perf(\(.+\))?:' }
$docs = $messages | Where-Object { $_ -match '^docs(\(.+\))?:' }
$other = $messages | Where-Object { $_ -notmatch '^(feat|feature|fix|perf|docs)(\(.+\))?:' }
$body = @()
$body += "## Release $currentTag"
$body += ""
$body += Section "Features" $features
$body += Section "Fixes" $fixes
$body += Section "Performance" $performance
$body += Section "Docs" $docs
$body += Section "Other" $other
$body += "### Assets"
$body += '- Windows installer: `ClipStack_*_x64-setup.exe`'
$body | Set-Content -Path release-notes.md -Encoding utf8
- name: Publish release
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.md
files: |
src-tauri/target/release/bundle/nsis/*.exe