Skip to content

Automatic updates with Sparkle, and republish 0.1.0 with them - #9

Merged
ravixalgorithm merged 1 commit into
mainfrom
auto-updates
Nov 8, 2026
Merged

ravixalgorithm merged 1 commit into
mainfrom
auto-updates

Conversation

@ravixalgorithm

@ravixalgorithm ravixalgorithm commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Why

People are downloading 0.1.0 now, and that build has no way to update itself. This adds updates and republishes 0.1.0 with them, so everyone who downloads from today gets every future version.

What changes

  • PortsUpdater: a small program inside the app that links Sparkle 2.10.0. The menu bar agent starts it a minute after launch and then once a day, so Sparkle is only in memory while it checks; the agent stays at about 12 MB. It asks before installing. Before it installs, it quits the old menu bar item so Sparkle's relaunch starts the new copy. As a fallback, the agent restarts itself if its app is replaced while it runs.
  • Gear menu: Check for Updates…, and Check Automatically (on by default).
  • Release workflow: signs the zip with the EdDSA key in the SPARKLE_ED_PRIVATE_KEY secret (scripts/appcast.sh) and publishes appcast.xml with each release. Installed copies read releases/latest/download/appcast.xml.
  • Re-runnable releases: if the release already exists, its files are replaced, so this build ships under the existing v0.1.0 link.
  • Version 0.1.0: the unreleased 0.1.1 changes fold into it.
  • README: the one daily network request, what GitHub sees (IP address and app version), and that updates install only after you agree and only when signed with this project's key.

Checked

  • A 0.1.0 copy, with its menu bar item running, found a signed 0.1.9 on a local feed and showed "A new version of Ports is available!". It installed after Install Update, then Install and Relaunch. The old menu bar item quit and the new copy took over.
  • Sparkle accepts these updates without a Developer ID: when the EdDSA signature is valid, a changed ad-hoc signature is allowed (SUUpdateValidator.m at 2.10.0).
  • scripts/appcast.sh signs a zip and writes valid XML, tested with a throwaway key.
  • swift test: 19 tests pass.

Before releasing

The SPARKLE_ED_PRIVATE_KEY secret has to be set. The release workflow stops if it's missing.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Check for updates from the settings menu or receive daily update checks, which can be turned off.
    • Updates require your confirmation before installation. After an update, the app reopens with the new version.
  • Documentation
    • Updated privacy information to explain update checks, the information shared during checks, and the installation approval process.

- PortsUpdater, a small program that links Sparkle 2.10.0. The menu bar
  agent starts it a minute after launch and once a day, so Sparkle is in
  memory only while it checks. It asks before installing, then quits the
  old menu bar item so the relaunch starts the new copy. The agent also
  restarts itself if its app is replaced underneath it.
- Gear menu: Check for Updates..., and Check Automatically (on by default).
- The release workflow signs the zip with the EdDSA key in the
  SPARKLE_ED_PRIVATE_KEY secret and publishes appcast.xml with each
  release. Installed copies read releases/latest/download/appcast.xml.
- A release that already exists has its files replaced, so this build
  can go out under the v0.1.0 link people already have.
- Version 0.1.0: the 0.1.1 changes fold into it, dated 2026-11-08.
- README: the one network request, what GitHub sees, and that updates
  install only after you agree and only if signed with this key.

Tested locally: a 0.1.0 copy with its menu bar item running found a signed
0.1.9 on a local feed, showed "A new version of Ports is available!",
installed after Install Update and Install and Relaunch, and the new copy
took over. swift test: 19 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 8, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Ports adds a Sparkle-based updater with scheduled and manual checks, an automatic-update preference, and update installation callbacks. The release workflow creates and publishes a signed appcast. The app bundle includes the updater and Sparkle framework.

Changes: Sparkle update delivery

Layer / File(s) Summary
Package and bundle the updater
Package.swift, build-app.sh
Adds Sparkle 2.10.0 and a PortsUpdater target. The app bundle includes the updater and Sparkle framework, with Sparkle components signed during packaging.
Run update checks and manage preferences
Sources/PortsCore/Restart.swift, Sources/PortsPanel/Panel.swift, Sources/PortsApp/MenuBarAgent.swift, Sources/PortsUpdater/main.swift, README.md
Adds automatic-update settings and menu actions, scheduled checks, updater callbacks, and restart handling when the on-disk app version changes. The README describes update checks, network visibility, and installation approval.
Generate and publish the signed feed
Sources/PortsCore/Ports.swift, CHANGELOG.md, scripts/appcast.sh, .github/workflows/release.yml
Signs the release archive and generates dist/appcast.xml from release notes. The workflow publishes the appcast and updates an existing tagged release or creates one. The version and changelog identify release 0.1.0.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant MenuBarAgent
  participant PortsUpdater
  participant Sparkle
  participant GitHub
  participant User
  MenuBarAgent->>PortsUpdater: Launch scheduled or requested check
  PortsUpdater->>Sparkle: Start background or interactive check
  Sparkle->>GitHub: Request appcast
  GitHub-->>Sparkle: Return signed update feed
  Sparkle->>User: Present available update
  User->>Sparkle: Approve installation
  Sparkle->>PortsUpdater: Begin installation
  PortsUpdater->>PortsUpdater: Terminate matching running PortsApp
Loading

Possibly related PRs

  • Open-Dev-Society/ports#6: This PR extends the release workflow and app features introduced in PR #6.
  • Open-Dev-Society/ports#8: This PR republishes version 0.1.0 with the unreleased 0.1.1 changes and updates the same version and changelog.
Merge Risk: Moderate · up to 6e3c3

Pin and verify the signing tools before merging. Release reruns can also cause update downloads to fail signature validation; smaller issues can omit release-note content or create duplicate windows and menu bar items.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ravixalgorithm
ravixalgorithm merged commit b4807dd into main Nov 8, 2026
1 check passed
@ravixalgorithm
ravixalgorithm deleted the auto-updates branch November 8, 2026 13:33
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