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
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,28 @@ jobs:
gh release create "v$VERSION" --verify-tag ${draft[@]+"${draft[@]}"} \
--title "Pladder $VERSION" --notes-file "$RUNNER_TEMP/notes.md" \
dist/release/Pladder.dmg dist/release/Pladder.dmg.sha256 dist/release/appcast.xml
- name: Bump the Homebrew cask
# The release is out by now, so a failed bump leaves the run green and
# is done by hand (INSTALL.md, "Homebrew"). A draft's DMG is not public,
# so the cask would point at a 404.
if: ${{ !inputs.draft }}
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
if [[ -z "$GH_TOKEN" ]]; then
echo "::error::No HOMEBREW_TAP_TOKEN in the release environment; bump the cask by hand."
exit 1
fi
sha=$(cut -d ' ' -f 1 dist/release/Pladder.dmg.sha256)
./scripts/cask.sh "$VERSION" "$sha" > "$RUNNER_TEMP/pladder.rb"
api=repos/dinooo13/homebrew-tap/contents/Casks/pladder.rb
# The first release creates the file; every later one replaces it.
old=()
if sha_old=$(gh api "$api" --jq .sha 2>/dev/null); then old=(-f sha="$sha_old"); fi
gh api -X PUT "$api" -f message="pladder $VERSION" ${old[@]+"${old[@]}"} \
-f content="$(base64 < "$RUNNER_TEMP/pladder.rb" | tr -d '\n')" \
--jq .commit.html_url
- name: Delete the tag of a release that was not published
# Deleting is allowed where creating is not, so this works even after
# main's workflows changed. A release that exists keeps its tag.
Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ swift test # unit tests, well under a second
./scripts/release.sh <version> # Developer ID, notarised, stapled → dist/release/Pladder.dmg; publishes nothing
./scripts/changelog.sh <last tag> [<ref>] # the release notes release.yml publishes, from the commit subjects
./scripts/appcast.sh <app> <dmg> <notes.md> # sign the DMG for Sparkle and print the release's appcast.xml
./scripts/cask.sh <version> [<sha256>] # the Homebrew tap's Casks/pladder.rb, from scripts/pladder.rb
swift run -c release pladder-cli <audio file> [--process] [--verbose] # transcribe one file to stdout; --process runs the app's processors, --verbose adds timing
./scripts/make-fixtures.sh # synthesise benchmark fixtures into bench/fixtures (gitignored)
swift run -c release pladder-cli bench bench/fixtures # whole-buffer benchmark
Expand All @@ -47,7 +48,7 @@ swift run -c release pladder-cli polish-set docs/polish-set.json --model s1-mini
| Topic | Choice | Why |
|---|---|---|
| Platform | macOS 26+, Apple Silicon only | FluidAudio needs the Neural Engine |
| Distribution | Direct, not sandboxed, not App Store: a Developer ID signed, notarised DMG on GitHub Releases, built by `release.yml`, dispatched by hand from `main` and approved in the `release` environment, which tags the commit first, runs the CI suite and `scripts/release.sh`, and publishes "Pladder <version>" with `Pladder.dmg`, its `.sha256`, an EdDSA-signed `appcast.xml` from `scripts/appcast.sh` and notes from `scripts/changelog.sh`. `release.sh` still runs by hand on the Mac | Global hotkey and synthetic paste do not work sandboxed. The certificate, as a `.p12`, and an App Store Connect API key for notarytool are `release` environment secrets, readable only by a run from `main` that a reviewer approved, imported into a keychain deleted as soon as `release.sh` is done; acceptable now that 0.1.0 proved the process by hand, and the key is scoped to the Developer role and revocable on its own. The Mac keeps its certificate and notarytool profile. The tag comes first because `GITHUB_TOKEN` cannot tag a commit whose workflows match no branch tip, so a workflow change pushed to `main` mid-run would fail the publish at the end; a run that does not publish deletes its tag. One DMG name for every release keeps `releases/latest/download/Pladder.dmg` stable for the site, and the version is in the tag and the title; one feed name keeps `releases/latest/download/appcast.xml` the newest release's |
| Distribution | Direct, not sandboxed, not App Store: a Developer ID signed, notarised DMG on GitHub Releases, built by `release.yml`, dispatched by hand from `main` and approved in the `release` environment, which tags the commit first, runs the CI suite and `scripts/release.sh`, and publishes "Pladder <version>" with `Pladder.dmg`, its `.sha256`, an EdDSA-signed `appcast.xml` from `scripts/appcast.sh` and notes from `scripts/changelog.sh`, then commits the new version and SHA-256 to the Homebrew cask in `dinooo13/homebrew-tap`. `release.sh` still runs by hand on the Mac | Global hotkey and synthetic paste do not work sandboxed. The certificate, as a `.p12`, and an App Store Connect API key for notarytool are `release` environment secrets, readable only by a run from `main` that a reviewer approved, imported into a keychain deleted as soon as `release.sh` is done; acceptable now that 0.1.0 proved the process by hand, and the key is scoped to the Developer role and revocable on its own. The Mac keeps its certificate and notarytool profile. The tag comes first because `GITHUB_TOKEN` cannot tag a commit whose workflows match no branch tip, so a workflow change pushed to `main` mid-run would fail the publish at the end; a run that does not publish deletes its tag. One DMG name for every release keeps `releases/latest/download/Pladder.dmg` stable for the site, and the version is in the tag and the title; one feed name keeps `releases/latest/download/appcast.xml` the newest release's. The cask is rendered from `scripts/pladder.rb`, so it is reviewed here and changes in the tap only with a release; its token, `HOMEBREW_TAP_TOKEN`, is scoped to the tap's contents, and a failed bump leaves the release green because the release is already out. It has no `auto_updates true`: with it `brew upgrade` skips the app, and automatic checks are off by default (INSTALL.md, "Homebrew") |
| Updates | Sparkle 2, from the app target only. "Check for Updates…" in the menu always; automatic checks (once a day) off by default, `checksForUpdatesAutomatically` in `settings.json`, handed to Sparkle at each launch and change. A scheduled find is one menu line, "Pladder <version> is available — Install…", and opens no window (gentle reminders); installing goes through the normal quit. The DMG is EdDSA-signed in `release.yml` with a `release` environment secret, checked before it is opened, and must carry the same Developer ID. No system profile, no automatic downloads, no first-run prompt | Without it a user had to notice a release, download it and replace the app by hand. The check is not the kind of request the privacy promise is about: it goes only to the GitHub repository the code and releases are in, so anyone can read what it does and where it goes, and it carries nothing about the user, the Mac or any dictation. Off by default, so a copy never told to check makes no request. A window that took focus mid-dictation would get the paste, hence the menu line. The setting lives in `settings.json` with every other one, so a test copy with its own file never checks because the live copy does. The private key is load-bearing: with it lost, every copy needs one manual update. Copies of 0.1.x have no updater and are replaced by hand once |
| Language | Swift 6.2 tools, strict concurrency, SwiftUI | Current toolchain |
| Build | SwiftPM package + `scripts/bundle.sh` wrapping the binary in `Pladder.app` | No Xcode project to maintain; `Package.swift` opens in Xcode |
Expand Down
54 changes: 53 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

Get `Pladder.dmg` from the [latest release](https://github.com/dinooo13/pladder/releases/latest), open it and drag Pladder to Applications.

Or install it with [Homebrew](https://brew.sh):

```sh
brew install --cask dinooo13/tap/pladder
```

It is the same notarised DMG, so macOS asks only the usual question at the first launch.

## Build and install

```sh
Expand Down Expand Up @@ -47,6 +55,12 @@ Pladder updates itself wherever it is, as long as you can write there. A copy op

**Copies of 0.1.x have no updater.** Replace one by hand once: quit Pladder, download the [latest DMG](https://github.com/dinooo13/pladder/releases/latest) and drag Pladder to Applications, replacing the old copy. From then on it updates itself.

A copy installed with Homebrew updates with the rest of your casks: `brew upgrade` quits Pladder, replaces it and opens it again. Check for Updates… works there too; after it has updated a copy, the next `brew upgrade` installs the same version once more, which costs a download and nothing else.

```sh
brew upgrade
```

A copy built from source: pull and run the same command again:

```sh
Expand All @@ -58,6 +72,15 @@ The install step quits the running copy and replaces it. Because the app is sign

## Uninstalling

A copy installed with Homebrew:

```sh
brew uninstall --cask pladder # the app only
brew uninstall --cask --zap pladder # also the settings, the dictionary and the speech model
```

Otherwise, by hand:

1. Quit Pladder from the menu bar.
2. Delete `/Applications/Pladder.app`.
3. Optionally delete the settings in `~/Library/Application Support/Pladder` and the models in `~/Library/Application Support/FluidAudio`.
Expand Down Expand Up @@ -97,7 +120,7 @@ A release comes from the **Release** workflow (`.github/workflows/release.yml`):
./scripts/changelog.sh v0.1.0 HEAD
```

Before anyone is asked to approve, a Linux job refuses a ref other than `main`, a version that is not `major.minor.patch`, one whose tag exists or that is not newer than the last tag, and a release in which nothing the build reads (the paths `ci.yml` builds for) changed since the last tag, unless **force** is ticked. The release job then waits for a reviewer of the `release` environment. Once approved, it tags the commit `v<version>`, builds and runs the tests as CI does, imports the certificate into a throwaway keychain, runs `scripts/release.sh`, checks that the build number is the commit count, signs the DMG with the update key and writes `appcast.xml` with `scripts/appcast.sh`, uploads the DMG as a workflow artifact, and publishes the release "Pladder <version>" with `Pladder.dmg`, its `.sha256`, `appcast.xml` and the notes from `scripts/changelog.sh`. Every release names its DMG `Pladder.dmg` and its feed `appcast.xml`, so `releases/latest/download/Pladder.dmg` always resolves and every copy's feed, `releases/latest/download/appcast.xml`, is always the newest release's; the version is in the tag and the title. Tick **draft** to check a release before it is public. The keychain and the key files are deleted as soon as `release.sh` is done, before the upload and the publish, and also when a step failed. The tag comes first because GitHub lets the workflow's token tag a commit only while its `.github/workflows` matches a branch tip: a push to `main` that changes a workflow during the run would otherwise fail it at the very end. If main's workflows changed between the dispatch and the approval, the job stops at once; run it again. A run that fails or is cancelled before the release exists deletes its tag, so it can simply be run again.
Before anyone is asked to approve, a Linux job refuses a ref other than `main`, a version that is not `major.minor.patch`, one whose tag exists or that is not newer than the last tag, and a release in which nothing the build reads (the paths `ci.yml` builds for) changed since the last tag, unless **force** is ticked. The release job then waits for a reviewer of the `release` environment. Once approved, it tags the commit `v<version>`, builds and runs the tests as CI does, imports the certificate into a throwaway keychain, runs `scripts/release.sh`, checks that the build number is the commit count, signs the DMG with the update key and writes `appcast.xml` with `scripts/appcast.sh`, uploads the DMG as a workflow artifact, and publishes the release "Pladder <version>" with `Pladder.dmg`, its `.sha256`, `appcast.xml` and the notes from `scripts/changelog.sh`, then bumps the [Homebrew](#homebrew) cask. Every release names its DMG `Pladder.dmg` and its feed `appcast.xml`, so `releases/latest/download/Pladder.dmg` always resolves and every copy's feed, `releases/latest/download/appcast.xml`, is always the newest release's; the version is in the tag and the title. Tick **draft** to check a release before it is public. The keychain and the key files are deleted as soon as `release.sh` is done, before the upload and the publish, and also when a step failed. The tag comes first because GitHub lets the workflow's token tag a commit only while its `.github/workflows` matches a branch tip: a push to `main` that changes a workflow during the run would otherwise fail it at the very end. If main's workflows changed between the dispatch and the approval, the job stops at once; run it again. A run that fails or is cancelled before the release exists deletes its tag, so it can simply be run again.

The changelog groups the commit subjects since the last tag by their `Area:` prefix, folds the internal areas (Tests, CI, Bench, Docs, Scripts) into an Internals group at the end, and links the pull request a subject names, `(#93)`, and the issues a body `Closes` or `Refs`. Merge and `fixup!` commits are left out.

Expand All @@ -111,6 +134,7 @@ The signing secrets live in the `release` environment, so only a run a reviewer
| `NOTARY_API_KEY_ID` | That key's ID |
| `NOTARY_API_ISSUER` | The issuer ID shown above the keys in App Store Connect |
| `SPARKLE_ED_PRIVATE_KEY` | The private EdDSA key updates are signed with, as `generate_keys -x` writes it (see [Update signing key](#update-signing-key)) |
| `HOMEBREW_TAP_TOKEN` | A fine-grained token for the tap; see [Homebrew](#homebrew) |

The API key, rather than an Apple ID and an app-specific password, because it can do no more than its role allows and can be revoked on its own. If a secret leaks, revoke the key in App Store Connect and the certificate in the developer portal.

Expand Down Expand Up @@ -156,6 +180,34 @@ rm sparkle-private-key.txt

`appcast.sh` by hand signs with the keychain's `pladder` account. Keep the offline copy somewhere safe: every copy checks the DMG against this one public key before opening it (`SUVerifyUpdateBeforeExtraction`), so with the private key lost no update can reach them, and each would have to be replaced by hand once more. If the key leaks, make a new pair, ship the new public key in a release signed with the old private key, and replace the secret.

### Homebrew

The cask lives in its own repository, [dinooo13/homebrew-tap](https://github.com/dinooo13/homebrew-tap), as `Casks/pladder.rb`, which is what `brew install --cask dinooo13/tap/pladder` reads. Its source is `scripts/pladder.rb` here, with the version and the SHA-256 left out; `scripts/cask.sh` fills them in. Change the cask here, not in the tap: the next release overwrites the tap's copy.

After the publish, the Release workflow writes `Casks/pladder.rb` for the new version and the SHA-256 of its DMG, and commits it to the tap through the GitHub API with `HOMEBREW_TAP_TOKEN`, as "pladder <version>"; the first release with the step, 0.2.0, creates the file. `brew upgrade` picks it up after the next `brew update`, which Homebrew runs by itself. A draft is not bumped, since its DMG is not public yet. A failed bump leaves the run green, since the release is already out; it shows as a failed step. Bump by hand then, or after publishing a draft, from a clone of the tap:

```sh
../pladder/scripts/cask.sh 0.1.3 > Casks/pladder.rb # reads the SHA-256 from the release
git commit -am "pladder 0.1.3" && git push
```

`HOMEBREW_TAP_TOKEN` is a fine-grained personal access token with access to `dinooo13/homebrew-tap` only, and only the **Contents: Read and write** permission. It is a `release` environment secret, like the signing secrets; when it expires, the bump fails until a new one is stored.

Check a change to the cask with `brew style` and `brew audit --cask --strict --online`, which need it in a tap. A throwaway local tap does it without touching the real one:

```sh
brew tap-new --no-git pladder-check/tap
mkdir -p "$(brew --repo pladder-check/tap)/Casks"
./scripts/cask.sh 0.1.2 > "$(brew --repo pladder-check/tap)/Casks/pladder.rb"
brew style --cask pladder-check/tap/pladder
brew audit --cask --strict --online pladder-check/tap/pladder
brew untap pladder-check/tap
```

`brew audit --new` also asks for the notability the main Homebrew repository wants, which Pladder does not meet yet. The cask does not say `auto_updates true`, although Pladder has an updater: that line makes `brew upgrade` skip the app unless `--greedy`, and Pladder checks for updates by itself only when the user turns that on, so most copies installed with Homebrew would never be updated.

Do not try `--zap` on a Mac you dictate on: it deletes the settings and the dictionary. The cask also quits Pladder by its bundle ID on uninstall and upgrade, so the copy you use is stopped too.

### Command-line transcriber

`pladder-cli` loads the same engine and prints the transcript for any audio file, and nothing else, so a script can read it. It is the quickest way to check the model without the GUI. `--verbose` adds timing, so you can see the real-time factor on your machine, and `--process` runs the app's processors over the text with your dictionary.
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ A dictionary fixes the words speech models get wrong: product names, libraries,

## Install

Pladder needs macOS 26 or later on Apple Silicon. Download `Pladder.dmg` from the [latest release](https://github.com/dinooo13/pladder/releases/latest), open it and drag Pladder to Applications.
Pladder needs macOS 26 or later on Apple Silicon. Download `Pladder.dmg` from the [latest release](https://github.com/dinooo13/pladder/releases/latest), open it and drag Pladder to Applications. Or install it with Homebrew, and update it with `brew upgrade`:

```sh
brew install --cask dinooo13/tap/pladder
```

Or build it from source in about a minute, with Xcode 26:

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Being honest about the edges is part of the model:

## Supported versions

Only the [latest release](https://github.com/dinooo13/pladder/releases/latest) gets fixes. Choose Check for Updates… in the menu to get one, or turn on automatic checks in Settings.
Only the [latest release](https://github.com/dinooo13/pladder/releases/latest) gets fixes. Choose Check for Updates… in the menu to get one, or turn on automatic checks in Settings; a copy installed with Homebrew also gets it from `brew upgrade`.

## Reporting a vulnerability

Expand Down
27 changes: 27 additions & 0 deletions scripts/cask.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
# Prints Casks/pladder.rb for the dinooo13/homebrew-tap repository: the
# template scripts/pladder.rb with a release's version and the SHA-256 of its
# Pladder.dmg. Without a SHA-256 it reads the release's Pladder.dmg.sha256.
# See INSTALL.md, "Homebrew".
#
# ./scripts/cask.sh 0.1.2 > ../homebrew-tap/Casks/pladder.rb

set -euo pipefail
cd "$(dirname "$0")/.."

version=${1:?usage: cask.sh <version> [<sha256>]}
sha=${2:-}

if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "cask.sh: version \"$version\" is not major.minor.patch" >&2
exit 1
fi
if [[ -z "$sha" ]]; then
sha=$(curl -fsSL "https://github.com/dinooo13/pladder/releases/download/v$version/Pladder.dmg.sha256" | cut -d ' ' -f 1)
fi
if [[ ! "$sha" =~ ^[0-9a-f]{64}$ ]]; then
echo "cask.sh: \"$sha\" is not a SHA-256" >&2
exit 1
fi

sed -e "s/@VERSION@/$version/" -e "s/@SHA256@/$sha/" scripts/pladder.rb
Loading
Loading