Skip to content

Commit 5414b7d

Browse files
committed
feat(dashboard): auto-update with Tauri updater plugin
- Added tauri-plugin-updater, plugin-process, plugin-dialog (Rust + npm) - Generated signing keypair (private key gitignored, pubkey tracked) - Configured updater endpoint to GitHub releases latest.json - Added capabilities/default.json with updater, dialog, process perms - Created updater.ts with check → download → install → relaunch flow - App.tsx polls for updates on mount then every 10 minutes - Shows persistent toast banner with 'Install & Restart' / 'Later' actions - Added dashboard-release.yml CI workflow for cross-platform builds with tauri-action generating signed updater artifacts - Requires TAURI_SIGNING_PRIVATE_KEY secret in GitHub repo settings
1 parent 2d12d44 commit 5414b7d

17 files changed

Lines changed: 807 additions & 4 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Dashboard Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "dashboard-v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
env:
13+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
14+
15+
jobs:
16+
build:
17+
name: Build Dashboard (${{ matrix.settings.label }})
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
settings:
22+
- host: macos-latest
23+
target: aarch64-apple-darwin
24+
label: macOS ARM64
25+
- host: macos-latest
26+
target: x86_64-apple-darwin
27+
label: macOS Intel
28+
- host: ubuntu-22.04
29+
target: x86_64-unknown-linux-gnu
30+
label: Linux x64
31+
- host: windows-latest
32+
target: x86_64-pc-windows-msvc
33+
label: Windows x64
34+
35+
runs-on: ${{ matrix.settings.host }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: oven-sh/setup-bun@v2
40+
with:
41+
bun-version: latest
42+
43+
- name: Install Rust stable
44+
uses: dtolnay/rust-toolchain@stable
45+
with:
46+
targets: ${{ matrix.settings.target }}
47+
48+
- name: Install Linux dependencies
49+
if: contains(matrix.settings.host, 'ubuntu')
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
53+
54+
- name: Install dependencies
55+
run: bun install
56+
57+
- name: Build and upload artifacts
58+
uses: tauri-apps/tauri-action@v0
59+
timeout-minutes: 30
60+
with:
61+
projectPath: packages/dashboard
62+
args: --target ${{ matrix.settings.target }}
63+
updaterJsonPreferNsis: true
64+
tagName: ${{ github.ref_name }}
65+
releaseDraft: true
66+
releaseAssetNamePattern: magic-context-dashboard-[platform]-[arch][ext]
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
70+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}

bun.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Private signing key — NEVER commit
2+
*.key
3+
# Public key is safe to track
4+
!*.key.pub
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDY5MUNBMDIxNjUxMEM2MkYKUldRdnhoQmxJYUFjYVU0SlNNbzRWMGJ3MndKOENIVDR0N0N6b0Jyd1l6TUNFTlpZTzV3RXlRYkEK

packages/dashboard/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
},
1414
"dependencies": {
1515
"@tauri-apps/api": "^2.5.0",
16+
"@tauri-apps/plugin-dialog": "^2.6.0",
17+
"@tauri-apps/plugin-process": "^2.3.1",
1618
"@tauri-apps/plugin-shell": "^2.2.2",
19+
"@tauri-apps/plugin-updater": "^2.10.0",
1720
"solid-js": "^1.9.5"
1821
},
1922
"devDependencies": {

0 commit comments

Comments
 (0)