Skip to content

Automatic app updates#124

Merged
mattdjenkinson merged 7 commits intomainfrom
automatic-app-updates
Mar 24, 2026
Merged

Automatic app updates#124
mattdjenkinson merged 7 commits intomainfrom
automatic-app-updates

Conversation

@mattdjenkinson
Copy link
Copy Markdown
Contributor

Overview

This branch adds stable vs beta update streams aligned with GitHub releases, extends the auto-update path with pending install and platform-specific apply/restart, improves Settings and toast UX, and updates CI so beta tags publish as GitHub pre-releases without touching Homebrew.


Library (lib)

Update channels

  • Introduces UpdateChannel (stable | beta) with serde (lowercase).
  • Default channel is inferred from the running build’s CARGO_PKG_VERSION: a semver pre-release segment (any - after an optional v prefix) ⇒ beta; otherwise stable.
  • UpdateSettings now includes:
    • update_channel
    • pending_install_path / pending_update_version (install on next launch / display)
    • Default check interval changed from 12h to 6h

GitHub releases API

  • Fetches up to 100 releases (per_page=100).
  • Deserializes draft and prerelease on each release.
  • select_release_for_channel: picks the newest eligible release that has a platform asset and is semver-newer than the installed version.
    • Stable: non-draft, not rolling, not GitHub pre-release, tag without - in the version part (after v).
    • Beta: GitHub pre-releases or hyphenated tags; does not offer plain stable releases to beta users.
  • Refactors asset lookup with try_find_platform_asset / find_platform_asset.

Install / restart

  • has_pending_install, get_pending_install_path, set_pending_install, clear_pending_install, get_pending_update_version.
  • apply_update / apply_update_static: macOS (DMG → mount, rsync to /Applications), Windows (NSIS /S), Linux (replace AppImage in place).
  • spawn_install_and_restart: detached helper (shell on Unix, PowerShell on Windows) that waits for the app to exit, runs install, then restarts.
  • DATUM_UPDATE_FAKE=1: skips real install for local UI/testing.

Other

  • Repo::from_path for paths used without opening the repo.
  • Re-exports UpdateChannel from lib.
  • Unit tests for channel inference and release selection (stable vs beta, drafts, hyphen tags, assets, ordering).

UI (ui)

  • Settings: stable / beta channel control, persisted via update settings; selected channel shows a check icon.
  • Update toast: both actions dismiss the toast; Install now clears in-flight update state consistently with Later while still triggering install.
  • Tailwind: toast container/list/item styles, success/error/warning/info variants, and supporting utilities (text-lg, ease-out, positioning, pb-48, etc.).
  • check.svg asset and icon wiring.

GitHub Actions

bundle.yml (tag push v*)

  • Classifies tag as beta if the version (after stripping v) contains -.
  • Beta ⇒ prerelease: true, make_latest: false; stable ⇒ prerelease: false, make_latest: true.
  • update-homebrew runs only for non–pre-release tags so the cask is not updated from beta builds.

manual-release.yml

  • Same tag-based beta vs stable classification for prerelease.
  • make_latest remains false for manual runs (unchanged policy).
  • Input description documents stable vs beta tag shape.

README

  • Shortened to download (including Homebrew), development prerequisites, and minimal run instructions for GUI and CLI.
Screenshot 2026-03-22 at 14 06 55 Screenshot 2026-03-22 at 14 07 11 Screenshot 2026-03-22 at 14 08 51

@mattdjenkinson mattdjenkinson merged commit 99171b1 into main Mar 24, 2026
12 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.

2 participants