| @@ -43,7 +43,7 @@ |
| 43 | 43 | - Modify: `Package.swift` (dependencies; `Orgstar` target) |
| 44 | 44 | - Modify: `scripts/build-app.sh` |
| 45 | 45 | |
| 46 | | - [ ] Add the dependency and the product to the app target: |
| 46 | - [x] Add the dependency and the product to the app target: |
| 47 | 47 | |
| 48 | 48 | ```swift |
| 49 | 49 | .package(url: "https://github.com/sparkle-project/Sparkle", from: "2.7.0"), |
| @@ -51,7 +51,7 @@ |
| 51 | 51 | .executableTarget(name: "Orgstar", dependencies: ["OrgApp", "OrgEditorAppKit", "OrgHighlight", .product(name: "Sparkle", package: "Sparkle")]), |
| 52 | 52 | ``` |
| 53 | 53 | |
| 54 | | - [ ] In `build-app.sh`, after copying the binary: copy the framework from the SwiftPM artifact and give the executable an rpath to it. |
| 54 | - [x] In `build-app.sh`, after copying the binary: copy the framework from the SwiftPM artifact and give the executable an rpath to it. |
| 55 | 55 | |
| 56 | 56 | ```sh |
| 57 | 57 | sparkle="$(find .build/artifacts -path '*Sparkle.xcframework/macos-*/Sparkle.framework' -maxdepth 6 | head -1)" |
| @@ -61,7 +61,7 @@ ditto "$sparkle" "$app/Contents/Frameworks/Sparkle.framework" |
| 61 | 61 | install_name_tool -add_rpath @executable_path/../Frameworks "$app/Contents/MacOS/Orgstar" |
| 62 | 62 | ``` |
| 63 | 63 | |
| 64 | | - [ ] Sign Sparkle's inner pieces before the app, with the same identity and flags (Sparkle's documented order), inside the final signing block: |
| 64 | - [x] Sign Sparkle's inner pieces before the app, with the same identity and flags (Sparkle's documented order), inside the final signing block: |
| 65 | 65 | |
| 66 | 66 | ```sh |
| 67 | 67 | fw="$app/Contents/Frameworks/Sparkle.framework/Versions/B" |
| @@ -70,7 +70,7 @@ for item in "$fw/XPCServices/Installer.xpc" "$fw/XPCServices/Downloader.xpc" "$f |
| 70 | 70 | done |
| 71 | 71 | ``` |
| 72 | 72 | |
| 73 | | - [ ] Add `SUFeedURL` and `SUPublicEDKey` to the generated Info.plist only when `sign` is not `-`: |
| 73 | - [x] Add `SUFeedURL` and `SUPublicEDKey` to the generated Info.plist only when `sign` is not `-`: |
| 74 | 74 | |
| 75 | 75 | ```sh |
| 76 | 76 | if [ "$sign" != "-" ]; then |
| @@ -82,8 +82,8 @@ fi |
| 82 | 82 | |
| 83 | 83 | and `${feed_keys}` in the plist heredoc after `LSMinimumSystemVersion`. The public key is pasted into `scripts/release-mac.sh` as a default for `ORGSTAR_ED_PUBLIC_KEY` once Task 3 generates it. |
| 84 | 84 | |
| 85 | | - [ ] Verify: `sh scripts/build-app.sh`, then `otool -l .build/app/orgstar.app/Contents/MacOS/Orgstar | grep -A2 LC_RPATH` shows the Frameworks rpath, `open .build/app/orgstar.app` launches, and `codesign --verify --strict --deep .build/app/orgstar.app` passes. |
| 86 | | - [ ] Commit "Link Sparkle and bundle its framework". |
| 85 | - [x] Verify: `sh scripts/build-app.sh`, then `otool -l .build/app/orgstar.app/Contents/MacOS/Orgstar | grep -A2 LC_RPATH` shows the Frameworks rpath, `open .build/app/orgstar.app` launches, and `codesign --verify --strict --deep .build/app/orgstar.app` passes. |
| 86 | - [x] Commit "Link Sparkle and bundle its framework". |
| 87 | 87 | |
| 88 | 88 | ### Task 2: Check for Updates… and the setting |
| 89 | 89 | |
| @@ -91,7 +91,7 @@ and `${feed_keys}` in the plist heredoc after `LSMinimumSystemVersion`. The publ |
| 91 | 91 | - Modify: `Sources/Orgstar/OrgstarApp.swift` (`AppDelegate` at line 151; `.commands`) |
| 92 | 92 | - Modify: `Sources/Orgstar/OrgstarApp.swift` (`SettingsView`, the General tab at line 551) |
| 93 | 93 | |
| 94 | | - [ ] In the app delegate, one controller for the process: |
| 94 | - [x] In the app delegate, one controller for the process: |
| 95 | 95 | |
| 96 | 96 | ```swift |
| 97 | 97 | import Sparkle |
| @@ -100,7 +100,7 @@ let updater = SPUStandardUpdaterController(startingUpdater: true, updaterDelegat |
| 100 | 100 | |
| 101 | 101 | Without a feed URL (dev builds) the updater logs that it can't start and `canCheckForUpdates` stays false; that is the intended dev behaviour. |
| 102 | 102 | |
| 103 | | - [ ] Menu item after About, following Sparkle's SwiftUI sample: |
| 103 | - [x] Menu item after About, following Sparkle's SwiftUI sample: |
| 104 | 104 | |
| 105 | 105 | ```swift |
| 106 | 106 | CommandGroup(after: .appInfo) { |
| @@ -111,9 +111,9 @@ CommandGroup(after: .appInfo) { |
| 111 | 111 | |
| 112 | 112 | `canCheckForUpdates` is KVO-observable; wrap the updater in a small `@Observable` holder that observes it, so the button enables once the updater starts. |
| 113 | 113 | |
| 114 | | - [ ] Settings ▸ General: a toggle bound to `updater.automaticallyChecksForUpdates`, shown only when `canCheckForUpdates` is true, labelled "Check for updates automatically". |
| 115 | | - [ ] Test by hand: a dev build shows the item disabled and no toggle; a `ORGSTAR_SIGN=<Developer ID>` build with a local feed (Task 4) shows both. |
| 116 | | - [ ] Commit "Check for Updates… and automatic checks". |
| 114 | - [x] Settings ▸ General: a toggle bound to `updater.automaticallyChecksForUpdates`, shown only when `canCheckForUpdates` is true, labelled "Check for updates automatically". |
| 115 | - [x] Test by hand: a dev build shows the item disabled and no toggle; a `ORGSTAR_SIGN=<Developer ID>` build with a local feed (Task 4) shows both. |
| 116 | - [x] Commit "Check for Updates… and automatic checks". |
| 117 | 117 | |
| 118 | 118 | ### Task 3: Keys and the appcast file |
| 119 | 119 | |
| @@ -122,8 +122,8 @@ CommandGroup(after: .appInfo) { |
| 122 | 122 | - Create: `scripts/appcast-add.sh` |
| 123 | 123 | - Modify: `docs/manual/orgo.toml` only if orgo needs the file listed to copy it (check with `scripts/publish-docs.sh --dry-run` and `ls` of the built site; `favicon.svg` and `style.css` are copied today, so it should not) |
| 124 | 124 | |
| 125 | | - [ ] Generate the key pair once on the release Mac: `"$(find .build/artifacts -name generate_keys -type f | head -1)"`. The private key goes to the login keychain; paste the printed public key as the `ORGSTAR_ED_PUBLIC_KEY` default in `release-mac.sh`. |
| 126 | | - [ ] The empty appcast: |
| 125 | - [ ] Generate the key pair once on the release Mac (not done here; it writes a private key to the login keychain): `"$(find .build/artifacts -name generate_keys -type f | head -1)"`. The private key goes to the login keychain; paste the printed public key as the `ORGSTAR_ED_PUBLIC_KEY` default in `release-mac.sh`. |
| 126 | - [x] The empty appcast: |
| 127 | 127 | |
| 128 | 128 | ```xml |
| 129 | 129 | <?xml version="1.0" encoding="utf-8"?> |
| @@ -135,7 +135,7 @@ CommandGroup(after: .appInfo) { |
| 135 | 135 | </rss> |
| 136 | 136 | ``` |
| 137 | 137 | |
| 138 | | - [ ] `scripts/appcast-add.sh <appcast> <version> <build> <dmg> <notes-file>`: runs `sign_update "$dmg"` (found under `.build/artifacts` like `generate_keys`), which prints `sparkle:edSignature="…" length="…"`, and inserts after `<link>…</link>` in the channel: |
| 138 | - [x] `scripts/appcast-add.sh <appcast> <version> <build> <dmg> <notes-file>`: runs `sign_update "$dmg"` (found under `.build/artifacts` like `generate_keys`), which prints `sparkle:edSignature="…" length="…"`, and inserts after `<link>…</link>` in the channel: |
| 139 | 139 | |
| 140 | 140 | ```xml |
| 141 | 141 | <item> |
| @@ -152,8 +152,8 @@ CommandGroup(after: .appInfo) { |
| 152 | 152 | |
| 153 | 153 | Insertion is a `sed`/`awk` on the first `</link>` after `<channel>`; the script refuses a version already present (`grep -q "<sparkle:shortVersionString>$version<"`) and ends with `xmllint --noout "$appcast"`. |
| 154 | 154 | |
| 155 | | - [ ] Verify with a throwaway copy: `scripts/appcast-add.sh /tmp/a.xml 0.2.0 365 .build/release/orgstar-0.2.0.dmg notes.txt` twice; the second run exits non-zero naming the version. |
| 156 | | - [ ] Commit "Appcast file and appcast-add.sh". |
| 155 | - [x] Verify with a throwaway copy: `scripts/appcast-add.sh /tmp/a.xml 0.2.0 365 .build/release/orgstar-0.2.0.dmg notes.txt` twice; the second run exits non-zero naming the version. |
| 156 | - [x] Commit "Appcast file and appcast-add.sh". |
| 157 | 157 | |
| 158 | 158 | ### Task 4: Release script and cask |
| 159 | 159 | |
| @@ -161,7 +161,7 @@ Insertion is a `sed`/`awk` on the first `</link>` after `<channel>`; the script |
| 161 | 161 | - Modify: `scripts/release-mac.sh` |
| 162 | 162 | - Modify: `packaging/orgstar.rb` |
| 163 | 163 | |
| 164 | | - [ ] After `gitbay release asset add` and before the tap section, add the appcast entry through a merge request, mirroring the tap block: |
| 164 | - [x] After `gitbay release asset add` and before the tap section, add the appcast entry through a merge request, mirroring the tap block: |
| 165 | 165 | |
| 166 | 166 | ```sh |
| 167 | 167 | notes="Universal (Apple silicon and Intel), macOS 26 or later. Notarized." |
| @@ -180,7 +180,14 @@ sh scripts/publish-docs.sh |
| 180 | 180 | |
| 181 | 181 | `$notes` replaces the literal string already passed to `gitbay release create`. With `ORGSTAR_PUBLISH=0` the script runs `appcast-add.sh` on a copy under `$out` and prints the entry instead, so a dry run shows the signature. |
| 182 | 182 | |
| 183 | | - [ ] Cask: add `auto_updates true` after `desc`, so `brew upgrade` leaves updating to the app. |
| 184 | | - [ ] End-to-end check before the first real release: build with a Developer ID, point a running copy at a local appcast with `defaults write sh.krz.orgstar SUFeedURL file:///tmp/a.xml` (Sparkle reads the feed from user defaults ahead of Info.plist), Check for Updates… offers the entry and installs the DMG; then `defaults delete sh.krz.orgstar SUFeedURL`. |
| 185 | | - [ ] Manual: `docs/manual/guide/01-files-and-folders.org` or `install.org` gets a paragraph on updates (menu item, the setting, that the cask has `auto_updates`). |
| 186 | | - [ ] Commit "Release script writes the appcast; cask auto_updates". |
| 183 | - [x] Cask: add `auto_updates true` after `desc`, so `brew upgrade` leaves updating to the app. |
| 184 | - [ ] End-to-end check before the first real release (needs a Developer ID build and the key): build with a Developer ID, point a running copy at a local appcast with `defaults write sh.krz.orgstar SUFeedURL file:///tmp/a.xml` (Sparkle reads the feed from user defaults ahead of Info.plist), Check for Updates… offers the entry and installs the DMG; then `defaults delete sh.krz.orgstar SUFeedURL`. |
| 185 | - [x] Manual: `docs/manual/guide/01-files-and-folders.org` or `install.org` gets a paragraph on updates (menu item, the setting, that the cask has `auto_updates`). |
| 186 | - [x] Commit "Release script writes the appcast; cask auto_updates". |
| 187 | |
| 188 | ## As built |
| 189 | |
| 190 | - Sparkle 2.10 from its SwiftPM package. `scripts/build-app.sh` copies the framework into `Contents/Frameworks`, adds the rpath, and for signed builds writes `SUFeedURL` and `SUPublicEDKey` (from `ORGSTAR_ED_PUBLIC_KEY`) into the Info.plist; a dev build has neither, so `Updates.start()` doesn't start the updater and Check for Updates… stays disabled. |
| 191 | - `Sources/Orgstar/Updates.swift` holds the `SPUStandardUpdaterController`, `canCheck` through Sparkle's KVO publisher, and the automatic-checks setting, shown in Settings ▸ General only when the updater runs. |
| 192 | - `scripts/appcast-add.sh` signs the DMG with `sign_update` and prepends the item; `SIGN_UPDATE` names another signer for a dry run. `scripts/release-mac.sh` runs it on a copy with `ORGSTAR_PUBLISH=0`, and for real after the DMG upload, through a merge request, then publishes the manual, which carries `docs/manual/appcast.xml`. |
| 193 | - Checked: the dev bundle launches with the framework and passes `codesign --verify --strict --deep`; the appcast script with a stub signer, twice (the second run refuses the version); `release-mac.sh` parses. Not checked: a signed build against a local appcast, which needs the Developer ID and the generated key. |