Desktop self-update from GitHub Releases (opt-in) - #3
Open
Manwe-777 wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Why it's safe to merge even if unsure
tauri:dev, on an unsigned build, or offline,check()throws/returns null andUpdateBannerrenders nothing. Plugin modules are dynamically imported, so the web bundle never pulls in Tauri internals.build.ymlonly appliestauri.conf.updater.json(which turns oncreateUpdaterArtifacts+latest.json) whenTAURI_SIGNING_PRIVATE_KEYis 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:
pnpm tauri signer generate -w ~/.tauri/pidtuna.keyTAURI_SIGNING_PRIVATE_KEY+TAURI_SIGNING_PRIVATE_KEY_PASSWORD.plugins.updater.pubkeyinsrc-tauri/tauri.conf.jsonwith your public key. (The placeholder's private key was discarded.)Per-platform reality (free minisign key, no paid certs)
.deb/.rpmnever self-update).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