From 3582cc3da6225563a2dd054d6900b6d1a7dc1a70 Mon Sep 17 00:00:00 2001 From: Austin Smith Date: Tue, 11 Aug 2026 22:16:50 -0700 Subject: [PATCH 1/2] allow ci without sparkle configuration --- .github/workflows/ci.yml | 40 ----------------------------------- Config/BuildSettings.xcconfig | 6 ++---- docs/build-settings.md | 9 +++++--- docs/sparkle-updates.md | 6 +++--- 4 files changed, 11 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d209e1d..0e6f102 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,26 +39,6 @@ jobs: - name: Checkout uses: actions/checkout@v7 - - name: Write CI build settings override - env: - SPARKLE_APPCAST_URL: ${{ vars.SPARKLE_APPCAST_URL }} - SPARKLE_PUBLIC_KEY: ${{ vars.SPARKLE_PUBLIC_KEY }} - run: | - if [[ -z "${SPARKLE_APPCAST_URL:-}" ]]; then - echo "Missing required repository variable: SPARKLE_APPCAST_URL" - exit 1 - fi - - if [[ -z "${SPARKLE_PUBLIC_KEY:-}" ]]; then - echo "Missing required repository variable: SPARKLE_PUBLIC_KEY" - exit 1 - fi - - cat > Config/BuildSettings.local.xcconfig < Config/BuildSettings.local.xcconfig < Date: Tue, 11 Aug 2026 22:39:42 -0700 Subject: [PATCH 2/2] store sparkle configuration in info plist --- .github/workflows/release.yml | 26 +++++-------------- .gitignore | 2 +- BitDream.xcodeproj/project.pbxproj | 14 ----------- BitDream/Info.plist | 4 +-- Config/BuildSettings.example.local.xcconfig | 3 --- Config/BuildSettings.xcconfig | 7 ------ docs/build-settings.md | 22 ---------------- docs/releases.md | 4 +-- docs/sparkle-updates.md | 28 +++++++++------------ scripts/tag-version.sh | 6 ----- 10 files changed, 23 insertions(+), 93 deletions(-) delete mode 100644 Config/BuildSettings.example.local.xcconfig delete mode 100644 Config/BuildSettings.xcconfig delete mode 100644 docs/build-settings.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4205ed8..ab33b0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,18 +23,18 @@ jobs: - name: Checkout uses: actions/checkout@v7 - - name: Load Sparkle build settings - env: - SPARKLE_APPCAST_URL: ${{ vars.SPARKLE_APPCAST_URL }} - SPARKLE_PUBLIC_KEY: ${{ vars.SPARKLE_PUBLIC_KEY }} + - name: Load Sparkle configuration run: | + SPARKLE_APPCAST_URL="$(/usr/libexec/PlistBuddy -c 'Print :SUFeedURL' BitDream/Info.plist 2>/dev/null || true)" + SPARKLE_PUBLIC_KEY="$(/usr/libexec/PlistBuddy -c 'Print :SUPublicEDKey' BitDream/Info.plist 2>/dev/null || true)" + if [[ -z "${SPARKLE_APPCAST_URL:-}" ]]; then - echo "Missing required repository variable: SPARKLE_APPCAST_URL" + echo "BitDream/Info.plist is missing SUFeedURL" exit 1 fi if [[ -z "${SPARKLE_PUBLIC_KEY:-}" ]]; then - echo "Missing required repository variable: SPARKLE_PUBLIC_KEY" + echo "BitDream/Info.plist is missing SUPublicEDKey" exit 1 fi @@ -47,13 +47,6 @@ jobs: echo "SPARKLE_APPCAST_URL=$SPARKLE_APPCAST_URL" >> "$GITHUB_ENV" echo "SPARKLE_PUBLIC_KEY=$SPARKLE_PUBLIC_KEY" >> "$GITHUB_ENV" - - name: Write CI build settings override - run: | - cat > Config/BuildSettings.local.xcconfig <SUEnableAutomaticChecks SUFeedURL - $(SPARKLE_APPCAST_URL) + https://austin-smith.github.io/BitDream/appcast.xml SUPublicEDKey - $(SPARKLE_PUBLIC_KEY) + +KG79p7oudH/MKhpfJ33550iZtqjQFKptFttQf1sGyI= UTExportedTypeDeclarations diff --git a/Config/BuildSettings.example.local.xcconfig b/Config/BuildSettings.example.local.xcconfig deleted file mode 100644 index a4369d2..0000000 --- a/Config/BuildSettings.example.local.xcconfig +++ /dev/null @@ -1,3 +0,0 @@ -// Copy this file to Config/BuildSettings.local.xcconfig and customize locally. -SPARKLE_APPCAST_URL = https:/$()/example.github.io/BitDream/appcast.xml -SPARKLE_PUBLIC_KEY = REPLACE_WITH_YOUR_SPARKLE_PUBLIC_KEY diff --git a/Config/BuildSettings.xcconfig b/Config/BuildSettings.xcconfig deleted file mode 100644 index 6aefdbf..0000000 --- a/Config/BuildSettings.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -// Shared build settings layer for repo-wide configurable values. -// Keep environment-specific values out of source-controlled project settings. -SPARKLE_APPCAST_URL = __UNSET__ -SPARKLE_PUBLIC_KEY = __UNSET__ - -// Optional local overrides for testing Sparkle update behavior. -#include? "BuildSettings.local.xcconfig" diff --git a/docs/build-settings.md b/docs/build-settings.md deleted file mode 100644 index 3603630..0000000 --- a/docs/build-settings.md +++ /dev/null @@ -1,22 +0,0 @@ -# Build Settings Reference - -## Files -- `Config/BuildSettings.xcconfig` (tracked): shared defaults and variable declarations. -- `Config/BuildSettings.example.local.xcconfig` (tracked): template for local setup. -- `Config/BuildSettings.local.xcconfig` (ignored): optional local overrides for Sparkle development. - -These files configure the direct-download `BitDream` target. The -`BitDreamAppStore` target neither reads Sparkle settings nor requires a local -override file. - -## Local Sparkle Setup - -The app builds without a local override file. To test Sparkle update behavior locally: - -1. Copy `Config/BuildSettings.example.local.xcconfig` to `Config/BuildSettings.local.xcconfig`. -2. Set local values (currently `SPARKLE_APPCAST_URL` and `SPARKLE_PUBLIC_KEY`). - -## CI / Release -- CI builds and tests with the tracked `__UNSET__` defaults, so pull requests from forks do not need access to repository variables. -- For Sparkle, release workflow uses repo variables `SPARKLE_APPCAST_URL` and `SPARKLE_PUBLIC_KEY`. -- The Mac App Store build uses its dedicated Sparkle-free target and scheme. diff --git a/docs/releases.md b/docs/releases.md index fe5071c..9c3ae78 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -1,6 +1,6 @@ # Creating a Release -Set the app and widget `MARKETING_VERSION` to the same `major.minor.patch` value and merge the change into `main`. The local checkout must be clean, match `origin/main`, and have `Config/BuildSettings.local.xcconfig` configured. +Set the app and widget `MARKETING_VERSION` to the same `major.minor.patch` value and merge the change into `main`. The local checkout must be clean and match `origin/main`. Run the preflight checks, then create a stable release tag: @@ -11,7 +11,7 @@ Run the preflight checks, then create a stable release tag: Pushing the tag starts `.github/workflows/release.yml`, which builds, signs, notarizes, and publishes the macOS release. The workflow rejects tags that do not match the Xcode marketing version. -See `docs/build-settings.md` and `docs/sparkle-updates.md` for configuration details. +See `docs/sparkle-updates.md` for Sparkle configuration details. This workflow publishes the direct-download build. See `docs/mac-app-store.md` for the separate Mac App Store archive process. diff --git a/docs/sparkle-updates.md b/docs/sparkle-updates.md index da21d13..40878bb 100644 --- a/docs/sparkle-updates.md +++ b/docs/sparkle-updates.md @@ -1,21 +1,17 @@ # Sparkle Update Configuration -## Required Variables -- `SPARKLE_APPCAST_URL`: Sparkle feed URL. -- `SPARKLE_PUBLIC_KEY`: Sparkle public key. +## App Configuration -## Build Contract -- `INFOPLIST_KEY_SUFeedURL[sdk=macosx*]` resolves from `$(SPARKLE_APPCAST_URL)`. -- `INFOPLIST_KEY_SUPublicEDKey[sdk=macosx*]` resolves from `$(SPARKLE_PUBLIC_KEY)`. +`BitDream/Info.plist` contains the public Sparkle configuration: -## Validation -- Local and pull request builds use the tracked `__UNSET__` defaults when no local override file is present. -- `Config/BuildSettings.local.xcconfig` can provide values when testing Sparkle locally. -- The release workflow validates `SPARKLE_APPCAST_URL` format and verifies embedded app `SUFeedURL` and `SUPublicEDKey` match expected values. +- `SUFeedURL`: Sparkle feed URL. +- `SUPublicEDKey`: Sparkle public EdDSA key. -## Release Workflow Contract -- GitHub repository variables: `SPARKLE_APPCAST_URL`, `SPARKLE_PUBLIC_KEY`. -- Workflow injects Sparkle settings into: - - app archive build (`xcodebuild archive`) - - appcast generation/download steps -- Workflow verifies embedded app values match `SPARKLE_APPCAST_URL` and `SPARKLE_PUBLIC_KEY`. +Local, pull request, and release builds all use these tracked values. The +release workflow verifies that the archived app contains the same values. + +## Release Signing + +The Sparkle private EdDSA key is stored in the GitHub Actions secret +`SPARKLE_PRIVATE_KEY_BASE64`. The release workflow uses it to sign appcast +entries. Never commit the private key. diff --git a/scripts/tag-version.sh b/scripts/tag-version.sh index e4284d2..c1149c7 100755 --- a/scripts/tag-version.sh +++ b/scripts/tag-version.sh @@ -64,12 +64,6 @@ if ! git remote get-url origin >/dev/null 2>&1; then exit 1 fi -if [[ ! -f Config/BuildSettings.local.xcconfig ]]; then - echo "Missing Config/BuildSettings.local.xcconfig." >&2 - echo "Create it from Config/BuildSettings.example.local.xcconfig before tagging a release." >&2 - exit 1 -fi - echo "Fetching origin/main and release tags..." git fetch origin refs/heads/main:refs/remotes/origin/main --tags