Skip to content

Commit 88de442

Browse files
committed
feat: add updater plugin and implement auto-update functionality
1 parent aeed394 commit 88de442

File tree

8 files changed

+456
-0
lines changed

8 files changed

+456
-0
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
permissions:
12+
contents: write
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- platform: 'macos-latest' # for Arm based macs (M1 and above).
18+
args: '--target aarch64-apple-darwin'
19+
- platform: 'macos-latest' # for Intel based macs.
20+
args: '--target x86_64-apple-darwin'
21+
- platform: 'ubuntu-22.04' # for Tauri v1 you could use ubuntu-20.04.
22+
args: ''
23+
- platform: 'windows-latest'
24+
args: ''
25+
26+
runs-on: ${{ matrix.platform }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: setup node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: lts/*
34+
35+
- name: install Rust stable
36+
uses: dtolnay/rust-toolchain@stable
37+
with:
38+
# Those targets are only used on macos runners so it's in an `if` to slightly speed up the linux/windows runners.
39+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
40+
41+
- name: install dependencies (ubuntu only)
42+
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
46+
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
47+
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
48+
49+
- name: install frontend dependencies
50+
run: npm ci # change this to npm or pnpm depending on which one you use.
51+
52+
- uses: tauri-apps/tauri-action@v0
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
56+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
57+
with:
58+
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
59+
releaseName: 'JSON Prettier v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
60+
releaseBody: 'See the assets to download and install this version.'
61+
releaseDraft: true
62+
prerelease: false
63+
args: ${{ matrix.args }}

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@tauri-apps/plugin-dialog": "^2.2.2",
1616
"@tauri-apps/plugin-opener": "^2.2.7",
1717
"@tauri-apps/plugin-shell": "^2.2.1",
18+
"@tauri-apps/plugin-updater": "^2.7.1",
1819
"lucide-react": "^0.511.0",
1920
"react": "^18.3.1",
2021
"react-dom": "^18.3.1"

0 commit comments

Comments
 (0)