Skip to content

Commit eaa98e2

Browse files
committed
release: v0.1.0
1 parent bdb8cce commit eaa98e2

5 files changed

Lines changed: 190 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "Existing tag to release (e.g. v0.2.0)"
11+
required: true
12+
type: string
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
prepare-release:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
tag: ${{ steps.tag.outputs.tag }}
22+
steps:
23+
- name: Resolve tag
24+
id: tag
25+
run: |
26+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
27+
echo "tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
30+
fi
31+
32+
- name: Create GitHub Release with auto notes
33+
uses: softprops/action-gh-release@v2
34+
with:
35+
tag_name: ${{ steps.tag.outputs.tag }}
36+
generate_release_notes: true
37+
draft: false
38+
prerelease: ${{ contains(steps.tag.outputs.tag, '-') }}
39+
40+
build-and-upload:
41+
needs: prepare-release
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- os: ubuntu-latest
47+
bundles: appimage,deb
48+
files: |
49+
src-tauri/target/release/bundle/appimage/*.AppImage
50+
src-tauri/target/release/bundle/deb/*.deb
51+
- os: windows-latest
52+
bundles: msi,nsis
53+
files: |
54+
src-tauri/target/release/bundle/msi/*.msi
55+
src-tauri/target/release/bundle/nsis/*.exe
56+
- os: macos-latest
57+
bundles: app,dmg
58+
files: |
59+
src-tauri/target/release/bundle/macos/*.app.tar.gz
60+
src-tauri/target/release/bundle/dmg/*.dmg
61+
runs-on: ${{ matrix.os }}
62+
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v4
66+
with:
67+
ref: ${{ needs.prepare-release.outputs.tag }}
68+
69+
- name: Setup Node.js
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: 20
73+
cache: npm
74+
75+
- name: Setup Rust
76+
uses: dtolnay/rust-toolchain@stable
77+
78+
- name: Install Linux system dependencies (Tauri)
79+
if: runner.os == 'Linux'
80+
run: |
81+
sudo apt-get update
82+
sudo apt-get install -y \
83+
build-essential \
84+
pkg-config \
85+
libgtk-3-dev \
86+
libayatana-appindicator3-dev \
87+
librsvg2-dev \
88+
patchelf
89+
sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev
90+
91+
- name: Install dependencies
92+
run: npm ci
93+
94+
- name: Build bundles
95+
run: npm run tauri -- build --bundles ${{ matrix.bundles }}
96+
97+
- name: Upload release assets
98+
uses: softprops/action-gh-release@v2
99+
with:
100+
tag_name: ${{ needs.prepare-release.outputs.tag }}
101+
files: ${{ matrix.files }}
102+
fail_on_unmatched_files: true

DEVELOPER_GUIDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,19 @@ cargo check --manifest-path src-tauri/Cargo.toml
231231
## 14. CI and Quality Gates
232232

233233
- GitHub Actions workflow: `.github/workflows/ci.yml`
234+
- GitHub Actions release workflow: `.github/workflows/release.yml`
234235
- Unified test entrypoint: `scripts/test-all.sh`
235236
- Frontend coverage thresholds (Vitest):
236237
- lines >= 90
237238
- statements >= 90
238239
- functions >= 90
239240
- branches >= 80
241+
242+
Release automation notes:
243+
244+
- release trigger: tag push `v*` (for example `v0.2.0`)
245+
- release notes: generated automatically by GitHub
246+
- artifacts uploaded by matrix build:
247+
- Linux: `.AppImage`, `.deb`
248+
- Windows: `.msi`, `.exe` (NSIS)
249+
- macOS: `.dmg`, `.app.tar.gz`

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,40 @@ Coverage policy (enforced):
110110
- functions >= 90%
111111
- branches >= 80%
112112

113+
## Automated Releases (GitHub)
114+
115+
Release builds are automated through `.github/workflows/release.yml`.
116+
117+
Trigger modes:
118+
119+
- push a tag like `v0.2.0` (recommended)
120+
- manual run via `workflow_dispatch` with an existing tag
121+
122+
What the workflow does:
123+
124+
1. creates/updates a GitHub Release with auto-generated release notes
125+
2. builds platform bundles on Linux, Windows, and macOS
126+
3. uploads downloadable assets to the Release
127+
128+
### Version + Tag Flow
129+
130+
Prepare version files:
131+
132+
```bash
133+
./scripts/release-tag.sh 0.2.0
134+
```
135+
136+
Then create and push the tag:
137+
138+
```bash
139+
git add package.json src-tauri/tauri.conf.json
140+
git commit -m "release: v0.2.0"
141+
git tag v0.2.0
142+
git push origin <your-branch> --tags
143+
```
144+
145+
After tag push, GitHub Actions will publish the release artifacts automatically.
146+
113147
## Icon Pipeline
114148

115149
Project icon source:

scripts/release-tag.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
if [ $# -ne 1 ]; then
5+
echo "Usage: $0 <version>"
6+
echo "Example: $0 0.2.0"
7+
exit 1
8+
fi
9+
10+
VERSION="$1"
11+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
12+
echo "Invalid version: $VERSION"
13+
exit 1
14+
fi
15+
16+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
17+
cd "$ROOT_DIR"
18+
19+
node -e '
20+
const fs = require("fs");
21+
const version = process.argv[1];
22+
const pkgPath = "package.json";
23+
const tauriPath = "src-tauri/tauri.conf.json";
24+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
25+
pkg.version = version;
26+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
27+
const tauri = JSON.parse(fs.readFileSync(tauriPath, "utf8"));
28+
tauri.version = version;
29+
fs.writeFileSync(tauriPath, JSON.stringify(tauri, null, 2) + "\n");
30+
' "$VERSION"
31+
32+
echo "Updated versions to $VERSION in:"
33+
echo "- package.json"
34+
echo "- src-tauri/tauri.conf.json"
35+
36+
echo
37+
echo "Next steps:"
38+
echo " git add package.json src-tauri/tauri.conf.json"
39+
echo " git commit -m 'release: v$VERSION'"
40+
echo " git tag v$VERSION"
41+
echo " git push origin <branch> --tags"

src-tauri/tauri.conf.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
},
2929
"bundle": {
3030
"active": true,
31-
"targets": ["app"],
31+
"targets": [
32+
"app"
33+
],
3234
"icon": [
3335
"icons/32x32.png",
3436
"icons/128x128.png",

0 commit comments

Comments
 (0)