Repository navigation
feature: sparkle ota updates published from ci - #5
Merged
Merged
Conversation
Sparkle was referenced as a package but never linked to the app target, so updates could not have worked. Link it, wire up the updater, and automate publishing from a tag push. App: - link Sparkle to the palium target and add UpdaterService owning the SPUStandardUpdaterController - expose "Check for Updates..." in the app menu and an Updates settings tab - drop SUEnableDownloaderService / SUEnableInstallerLauncherService from Info.plist; both are sandbox-only and palium is not sandboxed - check for updates daily in the background Release: - release.yml builds, EdDSA-signs and publishes on a v* tag; binaries go to the GitHub release, appcast.xml and release notes to gh-pages - the release is created before the appcast so the feed never points at a missing asset, and the built Info.plist is asserted against the tag - version comes from the tag, build number from the commit count so Sparkle's ordering key only ever increases - scripts/appcast.py edits a single item into the published appcast, since generate_appcast needs every archive ever shipped on disk - zip-app uses ditto; plain zip mangles the symlinks in Sparkle.framework and invalidates the code signature The signing key is read from the SPARKLE_PRIVATE_KEY secret over stdin and never touches the runner's disk. See docs/RELEASING.md for the one-time setup.
Package.resolved was ignored, so a release could silently build against any 2.x Sparkle the upToNextMajorVersion requirement allowed rather than the one that was tested. For the one dependency that installs code on users' machines that is worth pinning. - track project.xcworkspace so Package.resolved is versioned; a !negation cannot work here because git will not re-include a file whose parent directory is excluded. xcuserdata/ still covers the per-user noise. - pass -onlyUsePackageVersionsFromResolvedFile on archive and build-unsigned so the pin is enforced rather than advisory
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.
Sets up Sparkle for over-the-air updates and automates publishing from a tag push.
The bug this started from
Sparkle was present in the project as an
XCRemoteSwiftPackageReferencebut was never linked to the app target —packageProductDependenciesand the frameworks build phase were both empty. Nothing would have loaded at runtime.Two
Info.plistkeys also had to go.SUEnableDownloaderServiceandSUEnableInstallerLauncherServiceare sandbox-only, and Palium is not sandboxed — they would have routed updates through XPC services for no reason.App
paliumtarget;Sparkle.framework,AutoupdateandUpdater.appnow land in the bundleUpdaterServiceowns theSPUStandardUpdaterController, matching the existing@MainActor @Observablesingleton styleReleasing
git tag v1.1.0 && git push origin v1.1.0is the whole flow.appcast.xmland rendered release notes go togh-pagesInfo.plistis asserted against the tag before signing — a mismatch fails the run instead of shipping a bad appcastscripts/appcast.pyedits a single<item>into the published feed; Sparkle's owngenerate_appcastwants every archive ever shipped on disk, which CI does not havezip-appusesditto— plainzipmangles the symlinks inSparkle.frameworkand invalidates the code signatureThe EdDSA key is read from the
SPARKLE_PRIVATE_KEYsecret over stdin and never touches the runner's disk. Notesign_update -s <key>was removed in 2.9.4, which most guides still recommend.Sparkle is pinned to the exact revision in
Package.resolvedvia-onlyUsePackageVersionsFromResolvedFile, so a release ships the version that was tested.Verified locally
Real build →
dittozip →sign_update→--verifypasses → appcast generated → unzip round-trip preserves the code signature and framework. App launches with Sparkle loaded under hardened runtime + ad-hoc signing.make testpasses.Before merging — three manual steps
SPARKLE_PRIVATE_KEY(export withgenerate_keys -x). Back it up; losing it means existing installs can never be updated, since they only trust theSUPublicEDKeyalready in their bundle.gh-pagesafter the first release — that run creates the branch. Until Pages is live the appcast 404s and the app reports no updates; harmless, but do not read it as a broken updater.Palium still ships ad-hoc signed and un-notarized. Sparkle is fine with this (the EdDSA signature alone establishes trust), but first-time users must right-click ▸ Open.
docs/RELEASING.mdcovers the Developer ID upgrade path, which changes nothing about the appcast or the key.