Skip to content

Add Sparkle auto-update support#202

Open
nniel-ape wants to merge 1 commit intomaoyama:mainfrom
nniel-ape:sparkle-auto-update
Open

Add Sparkle auto-update support#202
nniel-ape wants to merge 1 commit intomaoyama:mainfrom
nniel-ape:sparkle-auto-update

Conversation

@nniel-ape
Copy link
Copy Markdown
Contributor

Closes #78

Summary

  • Integrate Sparkle 2.x via Swift Package Manager for automatic in-app updates
  • Add "Check for Updates…" menu item under the app menu
  • Add Settings window with update preferences (auto-check, auto-download, version info)
  • Extend release workflow to EdDSA-sign builds, generate appcast.xml, and deploy it to GitHub Pages

New Files

File Purpose
GitClient/Info.plist SUFeedURL (appcast) and SUPublicEDKey (placeholder)
GitClient/Models/Observables/CheckForUpdatesViewModel.swift Observable wrapper around SPUUpdater state
GitClient/Views/SettingsView.swift Settings window with update toggles and "Check for Updates" button

Modified Files

File Changes
GitClientApp.swift Initialize SPUStandardUpdaterController, add menu command & Settings scene
project.pbxproj / Package.resolved Add Sparkle SPM dependency
.github/workflows/release.yml Sign with Sparkle, generate appcast, deploy to gh-pages

Maintainer Setup

Before the first release with auto-updates, complete these one-time steps:

1. Generate an EdDSA keypair

Clone Sparkle and run:

swift package --package-path /path/to/Sparkle resolve
/path/to/Sparkle/.build/artifacts/Sparkle/bin/generate_keys

This prints a public key and stores the private key in your Keychain. Export the private key with generate_keys -x.

2. Replace the public key placeholder

In GitClient/Info.plist, replace PLACEHOLDER_EDDSA_PUBLIC_KEY with the public key from step 1.

3. Add the repository secret

Go to Settings → Secrets and variables → Actions and add:

  • Name: SPARKLE_EDDSA_PRIVATE_KEY
  • Value: the private key from step 1

4. Enable GitHub Pages

Go to Settings → Pages and set:

  • Source: Deploy from a branch
  • Branch: gh-pages / / (root)

The appcast will be served at https://maoyama.github.io/Changes/appcast.xml.

Test Plan

  • Project builds successfully with Sparkle dependency
  • All 34 existing tests pass
  • Verify "Check for Updates…" menu item appears under app menu
  • Verify Settings window opens with update preferences
  • After maintainer setup: verify release workflow signs and publishes appcast

Integrate Sparkle 2.x via Swift Package Manager for in-app auto-updates:

- Add SPUStandardUpdaterController to GitClientApp with "Check for Updates…" menu item
- Add CheckForUpdatesViewModel observable for update state management
- Add SettingsView with update preferences (auto-check, auto-download)
- Add Info.plist with SUFeedURL and SUPublicEDKey (placeholder)
- Extend release workflow to sign builds with Sparkle EdDSA, generate
  appcast.xml, and deploy to GitHub Pages
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.

Add app update functionality

1 participant