Skip to content

Commit e640a52

Browse files
chore: update CI/CD workflows and enhance release process
- Added CI workflow for pull request validation and testing. - Introduced release workflow for automated builds and asset uploads on version tags. - Created a release script to streamline version bumping and tagging process. - Updated README with new installation options and CI/CD details.
1 parent ad09bdb commit e640a52

5 files changed

Lines changed: 441 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- develop
8+
push:
9+
branches:
10+
- main
11+
- develop
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: lts/*
24+
25+
- name: Setup Rust
26+
uses: dtolnay/rust-toolchain@stable
27+
28+
- name: Cache Rust dependencies
29+
uses: Swatinem/rust-cache@v2
30+
with:
31+
workspaces: "./src-tauri -> target"
32+
33+
- name: Cache Node.js dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.npm
38+
web/node_modules
39+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
40+
restore-keys: |
41+
${{ runner.os }}-node-
42+
43+
- name: Install frontend dependencies
44+
run: npm ci
45+
working-directory: web
46+
47+
- name: Lint frontend
48+
run: npm run lint
49+
working-directory: web
50+
continue-on-error: true
51+
52+
- name: Test frontend
53+
run: npm run test
54+
working-directory: web
55+
continue-on-error: true
56+
57+
- name: Format check
58+
run: cargo fmt --all -- --check
59+
60+
- name: Clippy
61+
run: cargo clippy --workspace --all-targets -- -D warnings
62+
63+
- name: Test Rust
64+
run: cargo test --workspace --all-targets
65+
66+
- name: Build release
67+
run: cargo build --release --workspace
68+
69+
build-tauri:
70+
needs: test
71+
runs-on: ${{ matrix.os }}
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
include:
76+
- os: macos-latest
77+
args: "--target aarch64-apple-darwin"
78+
- os: ubuntu-22.04
79+
args: "--target x86_64-unknown-linux-gnu"
80+
- os: windows-latest
81+
args: "--target x86_64-pc-windows-msvc"
82+
83+
steps:
84+
- name: Checkout repository
85+
uses: actions/checkout@v4
86+
87+
- name: Install dependencies (ubuntu only)
88+
if: matrix.os == 'ubuntu-22.04'
89+
run: |
90+
sudo apt-get update
91+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
92+
93+
- name: Setup Node.js
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version: lts/*
97+
98+
- name: Setup Rust
99+
uses: dtolnay/rust-toolchain@stable
100+
with:
101+
targets: ${{ matrix.os == 'macos-latest' && 'aarch64-apple-darwin' || '' }}
102+
103+
- name: Cache Rust dependencies
104+
uses: Swatinem/rust-cache@v2
105+
with:
106+
workspaces: "./src-tauri -> target"
107+
108+
- name: Cache Node.js dependencies
109+
uses: actions/cache@v4
110+
with:
111+
path: |
112+
~/.npm
113+
web/node_modules
114+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
115+
restore-keys: |
116+
${{ runner.os }}-node-
117+
118+
- name: Install frontend dependencies
119+
run: npm ci
120+
working-directory: web
121+
122+
- name: Build frontend
123+
run: npm run build
124+
working-directory: web
125+
126+
- name: Build Tauri app
127+
uses: tauri-apps/tauri-action@v0
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
with:
131+
projectPath: src-tauri
132+
args: ${{ matrix.args }}
133+
tagName: app-v__VERSION__
134+
releaseName: "App v__VERSION__"
135+
releaseBody: "See the assets to download this version and install."
136+
draft: true
137+
prerelease: true

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- platform: "macos-latest"
18+
args: "--target aarch64-apple-darwin"
19+
- platform: "macos-latest"
20+
args: "--target x86_64-apple-darwin"
21+
- platform: "ubuntu-22.04"
22+
args: "--target x86_64-unknown-linux-gnu"
23+
- platform: "windows-latest"
24+
args: "--target x86_64-pc-windows-msvc"
25+
26+
runs-on: ${{ matrix.platform }}
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Install dependencies (ubuntu only)
32+
if: matrix.platform == 'ubuntu-22.04'
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: lts/*
41+
42+
- name: Setup Rust
43+
uses: dtolnay/rust-toolchain@stable
44+
with:
45+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
46+
47+
- name: Cache Rust dependencies
48+
uses: Swatinem/rust-cache@v2
49+
with:
50+
workspaces: "./src-tauri -> target"
51+
52+
- name: Cache Node.js dependencies
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
~/.npm
57+
web/node_modules
58+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
59+
restore-keys: |
60+
${{ runner.os }}-node-
61+
62+
- name: Install frontend dependencies
63+
run: npm ci
64+
working-directory: web
65+
66+
- name: Build frontend
67+
run: npm run build
68+
working-directory: web
69+
70+
- name: Build application
71+
uses: tauri-apps/tauri-action@v0
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
projectPath: src-tauri
76+
args: ${{ matrix.args }}
77+
78+
- name: Upload Release Assets
79+
if: startsWith(github.ref, 'refs/tags/')
80+
uses: softprops/action-gh-release@v2
81+
with:
82+
files: |
83+
src-tauri/target/${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin' || matrix.platform == 'ubuntu-22.04' && 'x86_64-unknown-linux-gnu' || 'x86_64-pc-windows-msvc' }}/release/bundle/**/*
84+
generate_release_notes: true
85+
draft: false
86+
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)