Skip to content

Commit 575822f

Browse files
Merge pull request #2 from Swofty-Developments/feat/release-ci
ci: add multi-platform tauri release workflow
2 parents 02904d0 + 0a83396 commit 575822f

3 files changed

Lines changed: 103 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- platform: macos-latest
19+
target: aarch64-apple-darwin
20+
label: macOS-arm64
21+
- platform: macos-latest
22+
target: x86_64-apple-darwin
23+
label: macOS-x64
24+
- platform: ubuntu-22.04
25+
target: x86_64-unknown-linux-gnu
26+
label: Linux-x64
27+
- platform: windows-latest
28+
target: x86_64-pc-windows-msvc
29+
label: Windows-x64
30+
31+
runs-on: ${{ matrix.platform }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Install Rust
36+
uses: dtolnay/rust-toolchain@stable
37+
with:
38+
targets: ${{ matrix.target }}
39+
40+
- name: Install Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 22
44+
45+
- name: Install Linux dependencies
46+
if: matrix.platform == 'ubuntu-22.04'
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y \
50+
libwebkit2gtk-4.1-dev \
51+
libappindicator3-dev \
52+
librsvg2-dev \
53+
patchelf \
54+
libgtk-3-dev \
55+
libsoup-3.0-dev \
56+
libjavascriptcoregtk-4.1-dev
57+
58+
- name: Set version from tag
59+
if: startsWith(github.ref, 'refs/tags/v')
60+
shell: bash
61+
run: |
62+
VERSION="${GITHUB_REF#refs/tags/v}"
63+
echo "Setting version to $VERSION"
64+
sed -i.bak "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
65+
for f in crates/*/Cargo.toml; do
66+
sed -i.bak "s/^version = \".*\"/version = \"$VERSION\"/" "$f" 2>/dev/null || true
67+
done
68+
rm -f Cargo.toml.bak crates/*/Cargo.toml.bak
69+
70+
- name: Install frontend dependencies
71+
working-directory: crates/tauri-app/frontend
72+
run: npm ci --ignore-scripts || npm install
73+
74+
- name: Install agent sidecar dependencies
75+
working-directory: crates/tauri-app/agent-sidecar
76+
run: npm ci --ignore-scripts || npm install
77+
78+
- name: Build frontend
79+
working-directory: crates/tauri-app/frontend
80+
run: npm run build
81+
82+
- name: Build Tauri app
83+
uses: tauri-apps/tauri-action@v0
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
87+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
88+
with:
89+
projectPath: crates/tauri-app
90+
args: --target ${{ matrix.target }} --verbose
91+
tagName: ${{ github.ref_name }}
92+
releaseName: ${{ github.ref_name }}
93+
releaseBody: ""
94+
releaseDraft: true
95+
prerelease: false
96+
includeUpdaterJson: true

crates/tauri-app/agent-sidecar/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"bundle": {
3+
"targets": ["deb", "rpm"]
4+
}
5+
}

0 commit comments

Comments
 (0)