Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tests

on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- name: Toolchain
run: swift --version
- name: Offline tests
run: ./test.sh
- name: Release build
run: ./build.sh
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Changelog

## Unreleased
## 0.4.1 — 2026-11-13

- Development builds no longer show up in Spotlight or Launchpad next to the installed app. `./build.sh` now builds `dist.noindex/UpdateWorkbench.app` (Spotlight skips folders ending in `.noindex`) and unregisters that copy from Launch Services. `./test.sh` creates its fixture apps and disk images in a temporary `.noindex` folder, and `./make-release.sh` stages the DMG contents in one.
- Direct installs download, extract and stage update copies in `.noindex` folders, so a half-finished update is never listed in Spotlight.
- Fixed version comparison. Versions were compared as text with numbers sorted numerically, so someone on a beta such as `1.0-beta.1` was never offered `1.0`, and `2.0.0` counted as newer than `2.0` (a "new" version that was the same one). Missing components now count as zero, pre-releases (`-beta.1`, `b2`, `rc1`, Preview, ...) come before their release, a trailing build such as `1.0 (45)` comes after it, and a leading `v` and `+build` metadata are ignored. The same order is used for feeds, GitHub and Electron releases, build numbers and minimum macOS versions.
- When GitHub's limit of 60 unauthenticated API requests an hour is reached, the message says so and gives the time it resets.
- Tests now run with `swift test` (Swift Testing) through a test target in `Package.swift`; `./test.sh` wraps it and passes extra arguments through. GitHub Actions runs the tests and a release build on every push to `main` and on pull requests.
- The version and build number are set once in `build.sh`; the app reads its version from `Info.plist`.
- The Sparkle, Electron and GitHub checks share one batching helper instead of three copies.
- Version 0.4.1 (build 7).

## 0.4.0 — 2026-11-12

Expand Down
13 changes: 11 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// swift-tools-version: 5.10
// swift-tools-version: 6.0
import PackageDescription
let package = Package(name: "UpdateWorkbench", platforms: [.macOS(.v14)], products: [.executable(name: "UpdateWorkbench", targets: ["UpdateWorkbench"])], targets: [.executableTarget(name: "UpdateWorkbench")])
let package = Package(
name: "UpdateWorkbench",
platforms: [.macOS(.v14)],
products: [.executable(name: "UpdateWorkbench", targets: ["UpdateWorkbench"])],
targets: [
.executableTarget(name: "UpdateWorkbench", swiftSettings: [.swiftLanguageMode(.v5)]),
// `swift test` (or ./test.sh) runs the offline suites against the app module with @testable import.
.testTarget(name: "UpdateWorkbenchTests", dependencies: ["UpdateWorkbench"], path: "Tests"),
]
)
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Update Workbench is a native macOS app that finds and installs updates for your

Requires macOS 14 or newer on Apple silicon. Check the download against `SHA256SUMS` with `shasum -a 256 -c SHA256SUMS`.

**Upgrading from 0.3.x:** quit Update Workbench, drag the new version into Applications and choose **Replace**. Settings, rules and approvals are kept. You may need the right-click **Open** step once more.
**Upgrading from an earlier version:** quit Update Workbench, drag the new version into Applications and choose **Replace**. Settings, rules and approvals are kept. You may need the right-click **Open** step once more.

**App Store updates (optional):** install the free `mas` tool with **Homebrew → Install mas…** (or `brew install mas` in Terminal) and stay signed in to the App Store app. When mas needs your Mac password to install an App Store update, click **Finish in Terminal** and type the password there. Update Workbench never sees it. You can also click **Open App Store Updates** and update in the App Store app.

Expand All @@ -20,12 +20,21 @@ Requires Xcode command-line tools.

```sh
./build.sh # builds dist.noindex/UpdateWorkbench.app (ad-hoc signed)
./test.sh # offline test suite
./test.sh # offline test suite (swift test); extra arguments go to swift test, e.g. --filter VersionOrderTests
./make-release.sh # DMG, ZIP and SHA256SUMS in release/
```

The version and build number are set once, at the top of `build.sh`. GitHub Actions runs `./test.sh` and `./build.sh` on every push to `main` and on pull requests.

Builds go to `dist.noindex/`. Spotlight skips folders whose names end in `.noindex`, so development builds, test fixtures and release staging never appear in Spotlight or Launchpad next to the copy in Applications.

## New in 0.4.1

- **Betas move on to the final release.** If you run a beta such as `1.0-beta.1`, the finished `1.0` is now offered. Before, it wasn't.
- **No more fake updates.** The same version written two ways (`2.0` and `2.0.0`) is no longer shown as an update.
- **Clearer GitHub limit message.** GitHub allows 60 checks an hour without an account. When that's reached, the app now says so and tells you when it resets.
- **Test copies stay out of Spotlight.** Development builds, test apps and half-finished updates are kept in folders Spotlight skips, so only the app in Applications shows up.

## New in 0.4.0

- **Signer changes you can review.** If an update is signed by a different developer team, Update Workbench stops and shows both teams with their certificate details. You can approve the new team for that one app after confirming; approvals are listed with dates in Settings → Trust and can be revoked. Code signing and Gatekeeper still have to pass.
Expand Down Expand Up @@ -79,6 +88,8 @@ To render every screen yourself in dark and light (fake data, no scanning, nothi
dist.noindex/UpdateWorkbench.app/Contents/MacOS/UpdateWorkbench --render-snapshots /tmp/updateworkbench-snapshots
```

Running the app from `dist.noindex/` registers that copy with Launch Services again. Run `./build.sh` afterwards, or `/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -u dist.noindex/UpdateWorkbench.app`, so it doesn't appear next to the installed app.

## Available features

- Inventory `/Applications`, `~/Applications`, and additional folders configured in Settings.
Expand Down
2 changes: 1 addition & 1 deletion Sources/UpdateWorkbench/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ final class WorkbenchModel: ObservableObject {
}
}
var ignoredItems: [UpdateItem] { items.filter { decision($0) != .show || isSnoozed($0) } }
var appVersion: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? AppIdentity.version }
var appVersion: String { AppIdentity.version }
var suggestions: [UpdateItem] {
items.filter { item in
(item.provider == .manual || item.provider == .vendor || (item.provider == .electron && !item.canUpdateDirectly))
Expand Down
163 changes: 74 additions & 89 deletions Sources/UpdateWorkbench/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,107 +249,92 @@ actor Engine {
diagnostics.append("App Store apps aren't checked because mas isn't installed. Choose Homebrew → Install mas… (or run `brew install mas`), then check again.")
}
// Keep requests bounded and preserve failures as unknown, never as up-to-date.
let feedIndices = items.indices.filter { items[$0].provider == .sparkle && items[$0].feedURL != nil }
for start in stride(from: 0, to: feedIndices.count, by: 6) {
let batch = feedIndices[start..<min(start + 6, feedIndices.count)].map {
($0, items[$0].feedURL!, items[$0].installedVersion, rules.allowsPrereleases(for: items[$0].id))
}
let results = await withTaskGroup(of: (Int, SparkleRelease?, String?).self) { group in
for (index, feed, version, prerelease) in batch {
group.addTask {
do { return (index, try await SparkleBackend.check(feedURL: feed, installedVersion: version, allowPrerelease: prerelease), nil) }
catch { return (index, nil, error.localizedDescription) }
}
}
var values: [(Int, SparkleRelease?, String?)] = []
for await value in group { values.append(value) }
return values
}
for (index, release, error) in results {
if let error {
items[index].detail = "Feed check failed: \(error)"
diagnostics.append("\(items[index].name): \(error)")
} else if let release {
items[index].latestVersion = release.version
items[index].sparkleRelease = release
items[index].isOutdated = true
items[index].detail = "Update available from the app's Sparkle feed. Installation verifies bundle identity and signing team."
} else { items[index].detail = "No compatible newer release found in the Sparkle feed." }
}
let feeds = items.indices.compactMap { index in
items[index].provider == .sparkle ? items[index].feedURL.map { (index, $0, items[index].installedVersion, rules.allowsPrereleases(for: items[index].id)) } : nil
}
for (index, release, error) in await Self.checkInBatches(feeds, { feed, version, prerelease in
try await SparkleBackend.check(feedURL: feed, installedVersion: version, allowPrerelease: prerelease)
}) {
if let error {
items[index].detail = "Feed check failed: \(error)"
diagnostics.append("\(items[index].name): \(error)")
} else if let release {
items[index].latestVersion = release.version
items[index].sparkleRelease = release
items[index].isOutdated = true
items[index].detail = "Update available from the app's Sparkle feed. Installation verifies bundle identity and signing team."
} else { items[index].detail = "No compatible newer release found in the Sparkle feed." }
}
// Electron apps that publicly declare an electron-updater feed in app-update.yml.
let electronIndices = items.indices.filter { items[$0].provider == .electron && items[$0].electronUpdate != nil }
for start in stride(from: 0, to: electronIndices.count, by: 6) {
let batch = electronIndices[start..<min(start + 6, electronIndices.count)].map {
($0, items[$0].electronUpdate!, items[$0].installedVersion, rules.allowsPrereleases(for: items[$0].id))
}
let results = await withTaskGroup(of: (Int, ElectronCheckResult?, String?).self) { group in
for (index, config, version, prerelease) in batch {
group.addTask {
do { return (index, try await ElectronBackend.check(config: config, installedVersion: version, allowPrerelease: prerelease), nil) }
catch { return (index, nil, error.localizedDescription) }
}
}
var values: [(Int, ElectronCheckResult?, String?)] = []
for await value in group { values.append(value) }
return values
}
for (index, result, error) in results {
if let error {
items[index].detail = "Electron update check failed: \(error)"
diagnostics.append("\(items[index].name): \(error)")
} else if let result {
items[index].latestVersion = result.version
items[index].sparkleRelease = result.release
items[index].isOutdated = true
if let page = result.releasePage { items[index].homepage = page }
items[index].detail = items[index].requiresSparkleSignature == true
? "Electron update available. This app requires a Sparkle archive signature; use its own updater." : result.note
} else { items[index].detail = "No newer stable release found in the app's Electron update feed." }
}
let electronFeeds = items.indices.compactMap { index in
items[index].provider == .electron ? items[index].electronUpdate.map { (index, $0, items[index].installedVersion, rules.allowsPrereleases(for: items[index].id)) } : nil
}
for (index, result, error) in await Self.checkInBatches(electronFeeds, { config, version, prerelease in
try await ElectronBackend.check(config: config, installedVersion: version, allowPrerelease: prerelease)
}) {
if let error {
items[index].detail = "Electron update check failed: \(error)"
diagnostics.append("\(items[index].name): \(error)")
} else if let result {
items[index].latestVersion = result.version
items[index].sparkleRelease = result.release
items[index].isOutdated = true
if let page = result.releasePage { items[index].homepage = page }
items[index].detail = items[index].requiresSparkleSignature == true
? "Electron update available. This app requires a Sparkle archive signature; use its own updater." : result.note
} else { items[index].detail = "No newer stable release found in the app's Electron update feed." }
}
// Explicit GitHub repositories supplement apps without a package-manager route.
let githubIndices = items.indices.filter { items[$0].provider == .github && items[$0].githubRepository != nil }
for start in stride(from: 0, to: githubIndices.count, by: 6) {
let batch = githubIndices[start..<min(start + 6, githubIndices.count)].map {
($0, items[$0].githubRepository!, items[$0].installedVersion, rules.allowsPrereleases(for: items[$0].id))
}
let results = await withTaskGroup(of: (Int, GitHubRelease?, String?).self) { group in
for (index, repository, version, prerelease) in batch {
group.addTask {
do { return (index, try await GitHubBackend.check(repository: repository, installedVersion: version, allowPrerelease: prerelease), nil) }
catch { return (index, nil, error.localizedDescription) }
}
let repositories = items.indices.compactMap { index in
items[index].provider == .github ? items[index].githubRepository.map { (index, $0, items[index].installedVersion, rules.allowsPrereleases(for: items[index].id)) } : nil
}
for (index, release, error) in await Self.checkInBatches(repositories, { repository, version, prerelease in
try await GitHubBackend.check(repository: repository, installedVersion: version, allowPrerelease: prerelease)
}) {
if let error {
items[index].detail = "GitHub check failed: \(error)"
diagnostics.append("\(items[index].name): \(error)")
} else if let release {
items[index].latestVersion = release.version
items[index].githubRelease = release
items[index].homepage = release.releasePageURL
items[index].isOutdated = true
if items[index].requiresSparkleSignature == true {
items[index].detail = "GitHub release available. This app requires a Sparkle archive signature; use its signed feed or vendor updater."
} else if release.downloadURL == nil {
items[index].detail = "GitHub release available. No single clearly native macOS payload was identified; choose a download on the release page."
} else {
items[index].detail = "GitHub release available from your configured repository. Direct installation verifies the app bundle, signing team, Gatekeeper, version and native CPU."
}
var values: [(Int, GitHubRelease?, String?)] = []
for await value in group { values.append(value) }
return values
}
for (index, release, error) in results {
if let error {
items[index].detail = "GitHub check failed: \(error)"
diagnostics.append("\(items[index].name): \(error)")
} else if let release {
items[index].latestVersion = release.version
items[index].githubRelease = release
items[index].homepage = release.releasePageURL
items[index].isOutdated = true
if items[index].requiresSparkleSignature == true {
items[index].detail = "GitHub release available. This app requires a Sparkle archive signature; use its signed feed or vendor updater."
} else if release.downloadURL == nil {
items[index].detail = "GitHub release available. No single clearly native macOS payload was identified; choose a download on the release page."
} else {
items[index].detail = "GitHub release available from your configured repository. Direct installation verifies the app bundle, signing team, Gatekeeper, version and native CPU."
}
} else { items[index].detail = "No newer stable GitHub release found." }
}
} else { items[index].detail = "No newer stable GitHub release found." }
}
return items.sorted {
if $0.isOutdated != $1.isOutdated { return $0.isOutdated }
return $0.name.localizedStandardCompare($1.name) == .orderedAscending
}
}

/// Runs one source's checks six at a time. Each result carries the item index and either the
/// check's value (nil when nothing newer was found) or the error text.
private static func checkInBatches<Source: Sendable, Value: Sendable>(
_ checks: [(Int, Source, String, Bool)],
_ check: @escaping @Sendable (Source, String, Bool) async throws -> Value?
) async -> [(Int, Value?, String?)] {
var results: [(Int, Value?, String?)] = []
for start in stride(from: 0, to: checks.count, by: 6) {
await withTaskGroup(of: (Int, Value?, String?).self) { group in
for (index, source, version, prerelease) in checks[start..<min(start + 6, checks.count)] {
group.addTask {
do { return (index, try await check(source, version, prerelease), nil) }
catch { return (index, nil, error.localizedDescription) }
}
}
for await value in group { results.append(value) }
}
}
return results
}

func update(_ item: UpdateItem, options: InstallOptions = InstallOptions()) async throws -> UpdateOutcome {
guard item.canUpdateDirectly else { throw UpdateError.unavailable("No verified direct update is available for \(item.name).") }
if let bundleID = item.bundleID,
Expand Down
Loading
Loading