Repository navigation
117 lines (97 loc) · 3.43 KB
/
Copy pathrelease.yml
File metadata and controls
117 lines (97 loc) · 3.43 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Release
on:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
test:
if: >-
github.event_name == 'workflow_dispatch' ||
!contains(github.event.head_commit.message, '[skip release]')
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- uses: dtolnay/rust-toolchain@stable
- name: Install frontend dependencies
run: npm ci
- name: Frontend unit tests
run: npm test
- name: Svelte typecheck
run: npm run check
- name: Build parsekit sidecar
run: npm run build:sidecar
- name: Rust unit tests
run: cargo test
working-directory: src-tauri
release:
needs: test
if: >-
always() &&
needs.test.result == 'success' &&
(github.event_name == 'workflow_dispatch' ||
!contains(github.event.head_commit.message, '[skip release]'))
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- uses: dtolnay/rust-toolchain@stable
- name: Install frontend dependencies
run: npm ci
- name: Resolve release version
id: version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash scripts/bump-version-if-needed.sh
- name: Skip — already released at this commit
if: steps.version.outputs.skip == 'true'
run: echo "No new release needed."
- name: Configure Tauri updater signing key
if: steps.version.outputs.skip != 'true'
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
run: |
if [[ -z "$TAURI_SIGNING_PRIVATE_KEY" ]]; then
echo "::error::Missing GitHub secret TAURI_SIGNING_PRIVATE_KEY (minisign private key for updater)."
exit 1
fi
mkdir -p "$HOME/.tauri"
printf '%s' "$TAURI_SIGNING_PRIVATE_KEY" > "$HOME/.tauri/parsekit.key"
- name: Build, sign, and publish macOS release
if: steps.version.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY_PATH: ${{ github.workspace }}/.tauri-ci/parsekit.key
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
# Prefer docs/releases/vX.Y.Z.md via scripts/release-notes.sh (do not dump commit subject).
run: |
mkdir -p .tauri-ci
cp "$HOME/.tauri/parsekit.key" "$TAURI_SIGNING_PRIVATE_KEY_PATH"
bash scripts/publish-release.sh
- name: Commit synced version back to master
if: steps.version.outputs.skip != 'true'
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json src-tauri/Cargo.toml src-tauri/tauri.conf.json README.md docs/INSTALL.md
if git diff --cached --quiet; then
echo "Version files already match v${VERSION}"
exit 0
fi
git commit -m "chore(release): sync v${VERSION} [skip release]"
git push