-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (67 loc) · 2.12 KB
/
Copy pathrelease.yml
File metadata and controls
78 lines (67 loc) · 2.12 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
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
- os: windows-latest
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri -> target
- name: Set version from tag
shell: bash
run: |
VERSION="${GITHUB_REF_NAME#v}"
jq --arg v "$VERSION" '.version = $v' src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json
sed -i.bak "s/^version = \"[^\"]*\"/version = \"$VERSION\"/" src-tauri/Cargo.toml && rm -f src-tauri/Cargo.toml.bak
- name: Build release notes from changelog
id: notes
shell: bash
run: |
VERSION="${GITHUB_REF_NAME#v}"
{
echo 'body<<CHANGELOG_EOF'
jq -r --arg v "$VERSION" '
.[$v] as $r
| if $r == null
then "Release " + $v
else "### " + $r.title + "\n\n" + $r.summary + "\n\n"
+ ($r.highlights | map("- " + .) | join("\n"))
end
' src/data/changelog.json
echo ''
echo '—'
echo 'Visit [stack.swendl.com](https://stack.swendl.com) for more information.'
echo 'CHANGELOG_EOF'
} >> "$GITHUB_OUTPUT"
- name: Install frontend dependencies
run: npm install
- name: Build and upload to release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: Stack ${{ github.ref_name }}
releaseBody: ${{ steps.notes.outputs.body }}
releaseDraft: false
prerelease: false