-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (65 loc) · 2.26 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (65 loc) · 2.26 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
name: Release (Windows)
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
key: windows
- name: Install dependencies
run: npm ci
- name: Check versions are in sync
run: npm run version:check
- name: Ensure tag version matches package version
shell: pwsh
run: |
$tag = $env:GITHUB_REF_NAME -replace '^v',''
$pkg = node -e "const fs=require('fs');process.stdout.write(JSON.parse(fs.readFileSync('package.json','utf8')).version)"
if ($tag -ne $pkg) {
Write-Error "Tag version ($tag) does not match package.json version ($pkg)."
exit 1
}
- name: Build desktop app
run: npm run tauri:build
- name: Extract release notes from CHANGELOG
id: changelog
shell: pwsh
run: |
$ver = $env:GITHUB_REF_NAME -replace '^v',''
node scripts/extract-changelog-section.mjs $ver release-notes.md
- name: Generate checksums
shell: pwsh
run: |
$ver = $env:GITHUB_REF_NAME -replace '^v',''
$out = "patternsoft-$ver-checksums.txt"
Get-ChildItem -Path src-tauri/target/release/patternsoft.exe, src-tauri/target/release/bundle -Recurse -File | ForEach-Object {
$hash = (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower()
$rel = $_.FullName -replace [regex]::Escape((Get-Location).Path + '\'), ''
"$hash $rel"
} | Set-Content -Path $out -Encoding utf8
- name: Create GitHub Release + upload assets
uses: softprops/action-gh-release@v2
with:
generate_release_notes: false
body_path: release-notes.md
files: |
src-tauri/target/release/patternsoft.exe
src-tauri/target/release/bundle/**/*
patternsoft-*-checksums.txt