Skip to content

feat: add self-update system#72

Merged
jafreck merged 1 commit intomainfrom
feat/self-update
Mar 30, 2026
Merged

feat: add self-update system#72
jafreck merged 1 commit intomainfrom
feat/self-update

Conversation

@jafreck
Copy link
Copy Markdown
Owner

@jafreck jafreck commented Mar 30, 2026

Summary

Add a self-update module that checks GitHub Releases for newer versions, downloads the platform-appropriate binary, and replaces the running executable in-place.

In-place replacement at the same path preserves macOS TCC grants (Accessibility, Input Monitoring, Microphone).

Changes

Core update module (murmur-core/src/update.rs)

  • Queries GitHub Releases API for the latest version
  • Compares semver to determine if an update is available
  • Downloads the platform-specific artifact (darwin-arm64, darwin-x86_64, linux-x86_64, windows-x86_64)
  • Extracts archive and atomically replaces the binary
  • Re-signs with codesign on macOS to preserve TCC grants

CLI subcommand

  • murmur update — check for updates and install
  • murmur update --check — check only, don't install

Config

  • auto_update: bool (default: false) — opt-in automatic updates on startup

Background startup check

  • Background thread checks for updates on launch
  • If auto_update is enabled, downloads and applies automatically
  • Otherwise notifies via tray menu

Tray menu

  • "Check for Updates…" menu item triggers a manual check
  • Label changes to "Update Available (vX.Y.Z)" when an update is found

Testing

  • 348 tests pass (3 new tests for version parsing, comparison, and platform detection)
  • Clean clippy, fmt

Add a self-update module that checks GitHub Releases for newer versions,
downloads the platform-appropriate binary, and replaces the running
executable in-place. In-place replacement at the same path preserves
macOS TCC grants (Accessibility, Input Monitoring, Microphone).

Components:
- murmur-core/src/update.rs: core update logic (check, download, replace)
  - Queries GitHub Releases API for latest version
  - Compares semver to determine if update is available
  - Downloads platform artifact (darwin-arm64, darwin-x86_64, linux-x86_64,
    windows-x86_64)
  - Extracts archive and atomically replaces the binary
  - Re-signs with codesign on macOS
- CLI: `murmur update` checks and installs; `murmur update --check` checks only
- Config: `auto_update: bool` (default false) for opt-in auto-updates
- Startup: background thread checks for updates on launch
  - If auto_update enabled, downloads and applies automatically
  - Otherwise notifies via tray menu
- Tray: "Check for Updates..." menu item, shows available version when found
@jafreck jafreck merged commit eea964a into main Mar 30, 2026
5 checks passed
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