Skip to content

Desktop self-update from GitHub Releases (opt-in) - #3

Open
Manwe-777 wants to merge 1 commit into
mainfrom
feat/tauri-self-update
Open

Desktop self-update from GitHub Releases (opt-in)#3
Manwe-777 wants to merge 1 commit into
mainfrom
feat/tauri-self-update

Conversation

@Manwe-777

Copy link
Copy Markdown
Owner

Wires up Tauri 2's updater so the desktop app can update itself from GitHub Releases. Exploratory — safe to sit on / reject; it stays completely dormant until a signing key is added, so it changes nothing about current builds or the dev loop.

What it does

  • On startup (Tauri only), checks the release manifest. If a newer signed build exists, a header pill "Update to vX.Y.Z" appears → click → download, install, relaunch.
  • The web/PWA build already updates via its service worker, so this only affects the downloaded desktop app.

Why it's safe to merge even if unsure

  • Frontend check is best-effort + silent. In the browser, during tauri:dev, on an unsigned build, or offline, check() throws/returns null and UpdateBanner renders nothing. Plugin modules are dynamically imported, so the web bundle never pulls in Tauri internals.
  • Signing is gated behind a secret. build.yml only applies tauri.conf.updater.json (which turns on createUpdaterArtifacts + latest.json) when TAURI_SIGNING_PRIVATE_KEY is set. Tag a release without it → still builds fine, just no self-update. No footgun.

To actually enable it (all free)

The updater's minisign key is free and separate from the paid OS code-signing certs:

  1. pnpm tauri signer generate -w ~/.tauri/pidtuna.key
  2. Add repo secrets TAURI_SIGNING_PRIVATE_KEY + TAURI_SIGNING_PRIVATE_KEY_PASSWORD.
  3. Replace the throwaway placeholder plugins.updater.pubkey in src-tauri/tauri.conf.json with your public key. (The placeholder's private key was discarded.)

Per-platform reality (free minisign key, no paid certs)

  • Linux — clean, AppImage only (.deb/.rpm never self-update).
  • Windows — works; SmartScreen prompt each update unless Authenticode-signed.
  • macOS — works, but without Apple notarization Gatekeeper quarantine can make updates flaky ("app is damaged"). Fine for personal/beta; notarize for a smooth public UX.

See the new README "In-app auto-update" section for details.

Verification

  • pnpm typecheck + pnpm build: clean.
  • cargo check (src-tauri): clean — updater + process plugins compile.

🤖 Generated with Claude Code

Wire up Tauri 2's updater so the desktop app can update itself from GitHub
Releases. On startup (Tauri only) it checks the release manifest and, if a
newer signed build exists, shows an "Update to vX.Y.Z" pill in the header that
downloads, installs, and relaunches. The web/PWA build keeps updating via its
service worker, so this only affects the downloaded desktop app.

Designed to stay completely dormant until a signing key is configured, so it
can't break existing builds or the dev loop:

- The frontend check is best-effort and silent — in the browser, during
  tauri:dev, on an unsigned build, or offline, check() throws/returns null and
  UpdateBanner renders nothing (plugin modules are dynamically imported so the
  web bundle never pulls in Tauri internals).
- Updater artifact signing is gated behind the TAURI_SIGNING_PRIVATE_KEY
  secret: build.yml only applies tauri.conf.updater.json (createUpdaterArtifacts
  + latest.json) when the secret is set, so tagging a release without it still
  succeeds — just without self-update.

The pubkey in tauri.conf.json is a THROWAWAY placeholder (its private key was
discarded); replace it with your own before signing a real release. The
updater's minisign key is free and separate from the paid OS code-signing certs
— see the new README "In-app auto-update" section for setup and the
per-platform reality (Linux AppImage clean; Windows/macOS work but with OS
warnings until code-signed/notarized).

Rust: registers tauri-plugin-updater (desktop-gated) + tauri-plugin-process;
capabilities grant updater:default and process:allow-restart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant