Skip to content
Open
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
42 changes: 40 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Both platforms, every PR — the same two builds the release runs, so a green
# PR means both halves of a release can be cut from it.
# Every platform, every PR — the same builds the release runs, so a green
# PR means all three parts of a release can be cut from it.
name: CI

on:
Expand Down Expand Up @@ -68,3 +68,41 @@ jobs:
- name: Package Tarball
working-directory: linux
run: SKIP_BUILD=1 bash packaging/make-tarball.sh

windows:
name: Windows
runs-on: windows-latest
timeout-minutes: 40
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Rust Version
run: rustc --version

- name: QA Smoke
working-directory: windows
run: bash scripts/run_qa_smoke.sh

- name: Build Release
working-directory: windows
run: cargo build --release --locked

- name: Package Zip
working-directory: windows
run: SKIP_BUILD=1 bash packaging/make-zip.sh

# Uploaded so a PR build can be downloaded and tested on a real Windows
# machine before anything is merged or released.
- name: Upload Windows Zip
uses: actions/upload-artifact@v4
with:
name: windows-zip
path: |
windows/dist/*.zip
windows/dist/*.zip.sha256
if-no-files-found: error
retention-days: 7
81 changes: 69 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# One tag, both platforms.
# One tag, every platform.
#
# A release is a single `vX.Y.Z` tag that carries the macOS DMG and the Linux
# tarball, cut from the same commit. The two builds run in parallel and both
# must pass before anything is published: the tag, the appcast commit and the
# GitHub Release are all created by the final `publish` job, so a failed build
# on either platform leaves no half-finished release behind.
# A release is a single `vX.Y.Z` tag that carries the macOS DMG, the Linux
# tarball, and the Windows zip, cut from the same commit. The builds run in
# parallel and all must pass before anything is published: the tag, the
# appcast commit and the GitHub Release are all created by the final
# `publish` job, so a failed build on any platform leaves no half-finished
# release behind.
#
# params ──┬── macos (signed, notarized DMG + appcast entry) ──┬── publish
# └── linux (tested, versioned tarball) ──────────────┘
# ├── linux (tested, versioned tarball) ──────────────┤
# └── windows (tested, versioned zip) ────────────────┘
name: Release

on:
Expand Down Expand Up @@ -416,10 +418,62 @@ jobs:
if-no-files-found: error
retention-days: 7

# Nothing is pushed until both platforms have built. This job owns the
windows:
needs: params
runs-on: windows-latest
timeout-minutes: 45
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.params.outputs.sha }}
fetch-depth: 0

- name: Stamp Version
env:
VERSION: ${{ needs.params.outputs.version }}
run: bash windows/packaging/set-version.sh "$VERSION"

- name: QA Smoke
working-directory: windows
run: bash scripts/run_qa_smoke.sh

- name: Build Zip
working-directory: windows
env:
VERSION: ${{ needs.params.outputs.version }}
run: bash packaging/make-zip.sh

- name: Verify Version Stamp
working-directory: windows
env:
VERSION: ${{ needs.params.outputs.version }}
run: |
set -euo pipefail
REPORTED="$(./target/release/whisper-smart.exe --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)"
if [[ "$REPORTED" != "$VERSION" ]]; then
echo "Built binary reports $REPORTED but the release is $VERSION"
exit 1
fi
echo "Windows binary reports $REPORTED"

- name: Upload Windows Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-release
path: |
windows/dist/*.zip
windows/dist/*.zip.sha256
if-no-files-found: error
retention-days: 7

# Nothing is pushed until every platform has built. This job owns the
# appcast commit, the version bump, the tag and the release itself.
publish:
needs: [params, macos, linux]
needs: [params, macos, linux, windows]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -439,9 +493,10 @@ jobs:
run: |
set -euo pipefail
cp artifacts/macos-release/appcast.xml appcast.xml
# Same stamp the Linux build used, so the committed manifest matches
# the binary that shipped.
# Same stamps the platform builds used, so the committed manifests
# match the binaries that shipped.
bash linux/packaging/set-version.sh "$VERSION"
bash windows/packaging/set-version.sh "$VERSION"

- name: Compose Release Notes
id: notes
Expand Down Expand Up @@ -470,7 +525,7 @@ jobs:
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add appcast.xml linux/Cargo.toml linux/Cargo.lock linux/packaging/PKGBUILD linux/packaging/aur/whisper-smart/PKGBUILD
git add appcast.xml linux/Cargo.toml linux/Cargo.lock linux/packaging/PKGBUILD linux/packaging/aur/whisper-smart/PKGBUILD windows/Cargo.toml windows/Cargo.lock
if git diff --cached --quiet; then
echo "Nothing to commit."
else
Expand Down Expand Up @@ -526,6 +581,8 @@ jobs:
artifacts/macos-release/appcast.xml
artifacts/linux-release/*.tar.gz
artifacts/linux-release/*.tar.gz.sha256
artifacts/windows-release/*.zip
artifacts/windows-release/*.zip.sha256

# The AUR stable package builds from the tag tarball, so its checksum can
# only be computed once the tag exists. Doing it here keeps the packaging
Expand Down
37 changes: 34 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,24 @@ Smoke tests use London School mocking (MockHotkeyMonitor, MockAudioCapture, Mock

## Release

One tag ships both platforms: `vX.Y.Z` carries the macOS DMG and the Linux tarball, built from the same commit. `.github/workflows/release.yml` runs `params` → (`macos` ‖ `linux`) → `publish`; **both platform builds must pass** before the appcast commit, the version bump, the tag, or the release exist. Full detail in `docs/RELEASE.md`.
One tag ships every platform: `vX.Y.Z` carries the macOS DMG, the Linux tarball, and the Windows zip, built from the same commit. `.github/workflows/release.yml` runs `params` → (`macos` ‖ `linux` ‖ `windows`) → `publish`; **all platform builds must pass** before the appcast commit, the version bump, the tag, or the release exist. Full detail in `docs/RELEASE.md`.

It runs two ways:
- **Automatic**: every merged PR into `main` cuts a beta release with an auto-bumped patch version. PR labels `release:minor` / `release:major` bump differently; the `skip-release` label opts out; docs/site/CI-only PRs never trigger.
- **Manual**: `gh workflow run release.yml -f version=X.Y.Z -f channel=beta -f checklist_confirmed=true -f notes="..."` for explicit versions or production releases.

The version is resolved once and propagated: macOS via the `VERSION` env, Linux via `linux/packaging/set-version.sh` (Cargo manifest, lockfile, both PKGBUILDs). Never bump those by hand. Release notes for both the GitHub Release and the Sparkle appcast come from `scripts/compose_release_notes.sh`.
The version is resolved once and propagated: macOS via the `VERSION` env, Linux via `linux/packaging/set-version.sh` (Cargo manifest, lockfile, both PKGBUILDs), Windows via `windows/packaging/set-version.sh`. Never bump those by hand. Release notes for both the GitHub Release and the Sparkle appcast come from `scripts/compose_release_notes.sh`.

Local artifacts (testing only — ad-hoc signed, never published):

```bash
VERSION=X.Y.Z ALLOW_ADHOC_SIGNING=1 bash scripts/package_dmg.sh # macOS DMG
cd linux && VERSION=X.Y.Z bash packaging/make-tarball.sh # Linux tarball
cd windows && VERSION=X.Y.Z bash packaging/make-zip.sh # Windows zip (Git Bash)
bash scripts/compose_release_notes.sh --version X.Y.Z # Preview notes
```

`.github/workflows/ci.yml` runs the same two builds (macOS + Linux) on every PR.
`.github/workflows/ci.yml` runs the same three builds (macOS + Linux + Windows) on every PR; the Windows job also uploads its zip as a workflow artifact so a PR build can be tested on a real machine before merging.

## Architecture

Expand Down Expand Up @@ -173,6 +174,36 @@ Two behavioural differences are deliberate: there is no microphone-permission
state (PipeWire needs no TCC-style prompt), and an unusable local provider never
falls back to the cloud unless the user explicitly enabled it *and* saved a key.

## Windows Port (`windows/`)

A separate Rust implementation for Windows 10/11, mirroring `linux/` module for
module — same core, same STT engines and model catalog, same Python sidecar
protocol. The UI is egui (pure Rust, no system toolkit) carrying the same
design tokens; the platform layer is Win32: `WH_KEYBOARD_LL` hook for the
hotkey (left/right modifiers are distinct VK codes), `SendInput` Unicode
typing + Ctrl+V paste for insertion, WASAPI via cpal for audio. whisper.cpp
stays the default provider: the app installs the official prebuilt
`whisper-cli.exe` (pinned by checksum) on request, since Windows has no distro
package manager. See `windows/README.md` for the full mapping.

```bash
cd windows
cargo build --release # on Windows (MSVC)
bash scripts/run_qa_smoke.sh # fmt + clippy + tests + sidecar syntax
```

The crate also builds and tests on Unix hosts (platform integrations stubbed),
and the Win32 layer is verified from them with
`cargo check --target x86_64-pc-windows-msvc`.

| Linux | Windows |
|-------|---------|
| `linux/src/platform/hotkey.rs` (evdev) | `windows/src/platform/hotkey.rs` (WH_KEYBOARD_LL) |
| `linux/src/platform/injector.rs` (wtype + paste) | `windows/src/platform/injector.rs` (SendInput + paste) |
| `linux/src/platform/compositor.rs` | `windows/src/platform/focus.rs` (foreground process) |
| `linux/src/ui/*` (GTK4 + layer-shell + ksni) | `windows/src/ui/*` (egui + tray-icon) |
| `~/.config/whisper-smart/config.toml` | `%APPDATA%\whisper-smart\config.toml` |

## File Organization

- `app/App/` — Entry point, AppDelegate, UpdateManager
Expand Down
33 changes: 22 additions & 11 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Releasing Whisper Smart

One tag ships both platforms. `vX.Y.Z` carries the macOS DMG and the Linux
tarball, built from the same commit by
One tag ships every platform. `vX.Y.Z` carries the macOS DMG, the Linux
tarball, and the Windows zip, built from the same commit by
[`.github/workflows/release.yml`](../.github/workflows/release.yml).

```
params ──┬── macos release gate → signed + notarized DMG → appcast entry ──┬── publish
└── linux QA smoke → versioned tarball → version check ──────────┘
├── linux QA smoke → versioned tarball → version check ──────────┤
└── windows QA smoke → versioned zip → version check ──────────────┘
```

`params` resolves the version, channel, changelog range **and commit SHA**
once. Every later job checks out that SHA rather than a branch name, so a merge
landing on `main` mid-run cannot give the two platform builds different source,
landing on `main` mid-run cannot give the platform builds different source,
or tag artifacts as containing work that was not in them.

They run in parallel and **both must pass** before `publish` does anything: the
They run in parallel and **all must pass** before `publish` does anything: the
appcast commit, the version bump, the tag and the GitHub Release are all
created in that last job. A failed build on either platform leaves no tag, no
created in that last job. A failed build on any platform leaves no tag, no
release, and no half-updated appcast behind.

`publish` tags the commit it built, pushes the tag, and only then updates
Expand Down Expand Up @@ -64,13 +65,14 @@ bump by hand:
|---|---|
| macOS app bundle | `VERSION` env → `scripts/build_release_app.sh` |
| Linux binary (`CARGO_PKG_VERSION`) | `linux/packaging/set-version.sh` → `linux/Cargo.toml` + `Cargo.lock` |
| Both PKGBUILDs (`pkgver`) | same script |
| Windows binary (`CARGO_PKG_VERSION`) | `windows/packaging/set-version.sh` → `windows/Cargo.toml` + `Cargo.lock` |
| Both PKGBUILDs (`pkgver`) | the Linux script |
| AUR checksum (`sha256sums`) | computed from the tag tarball after the tag is pushed |
| `appcast.xml` | `scripts/update_appcast.sh`, signed with `SPARKLE_PRIVATE_KEY` |

The Linux job asserts the built binary reports the release version before the
artifact is allowed out, so a missed stamp fails the run rather than shipping a
mislabelled tarball.
The Linux and Windows jobs assert the built binary reports the release
version before the artifact is allowed out, so a missed stamp fails the run
rather than shipping a mislabelled artifact.

## Release notes

Expand All @@ -93,6 +95,8 @@ bookkeeping commits filtered out.
| macOS | `appcast.xml` | Sparkle feed, also committed to `main` and mirrored to `master` for legacy clients |
| Linux x86_64 | `whisper-smart-<version>-linux-x86_64.tar.gz` | Built on Arch against GTK 4; relocatable, carries its own `install.sh` |
| Linux | `…tar.gz.sha256` | Checksum for the tarball |
| Windows 10/11 x86_64 | `whisper-smart-<version>-windows-x86_64.zip` | Self-contained folder; unzip and run `whisper-smart.exe` |
| Windows | `…zip.sha256` | Checksum for the zip |

## Secrets the workflow needs

Expand All @@ -102,7 +106,7 @@ bookkeeping commits filtered out.
| `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID` | Notarization (mandatory for Developer ID builds) |
| `SPARKLE_PRIVATE_KEY` | Signing the appcast entry |

The Linux job needs no secrets.
The Linux and Windows jobs need no secrets.

## Before a production release

Expand All @@ -119,6 +123,11 @@ VERSION=X.Y.Z ALLOW_ADHOC_SIGNING=1 bash scripts/package_dmg.sh
cd linux
bash packaging/set-version.sh X.Y.Z
VERSION=X.Y.Z bash packaging/make-tarball.sh

# Windows (from Git Bash)
cd windows
bash packaging/set-version.sh X.Y.Z
VERSION=X.Y.Z bash packaging/make-zip.sh
```

Local DMGs are ad-hoc signed and are for testing only — Gatekeeper blocks them
Expand Down Expand Up @@ -150,3 +159,5 @@ tarballs unpack to a directory with `install.sh`, which installs under
`sips`, `iconutil` and `hdiutil` on PATH.
- **Linux**: Rust 1.85+, `pkgconf`, and the GTK 4 stack (`gtk4`,
`gtk4-layer-shell`, `alsa-lib`, `libpulse`).
- **Windows**: Rust 1.85+ (MSVC toolchain) and Git Bash for the packaging
script. No other system dependencies — the UI is pure Rust.
11 changes: 7 additions & 4 deletions scripts/compose_release_notes.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env bash
# Composes the release notes for one version, for both platforms.
# Composes the release notes for one version, for every platform.
#
# A release is a single tag carrying a macOS DMG and a Linux tarball, so the
# notes are written once here and reused everywhere: the GitHub Release body,
# the Sparkle appcast entry, and a local dry run before tagging anything.
# A release is a single tag carrying a macOS DMG, a Linux tarball, and a
# Windows zip, so the notes are written once here and reused everywhere: the
# GitHub Release body, the Sparkle appcast entry, and a local dry run before
# tagging anything.
#
# bash scripts/compose_release_notes.sh --version 0.5.0 --channel beta
#
Expand Down Expand Up @@ -82,6 +83,7 @@ if [[ "$FORMAT" == "appcast" ]]; then
fi

LINUX_TARBALL="whisper-smart-${VERSION}-linux-x86_64.tar.gz"
WINDOWS_ZIP="whisper-smart-${VERSION}-windows-x86_64.zip"
DOWNLOAD_BASE="https://github.com/${REPOSITORY}/releases/download/${TAG}"

cat <<EOF
Expand All @@ -91,6 +93,7 @@ cat <<EOF
|---|---|---|
| macOS 14+ | [Whisper-Smart-mac.dmg](${DOWNLOAD_BASE}/Whisper-Smart-mac.dmg) | Open the DMG, drag the app to Applications |
| Linux (x86_64) | [${LINUX_TARBALL}](${DOWNLOAD_BASE}/${LINUX_TARBALL}) | \`tar xzf ${LINUX_TARBALL} && ./whisper-smart-${VERSION}-linux-x86_64/install.sh\` |
| Windows 10/11 (x86_64) | [${WINDOWS_ZIP}](${DOWNLOAD_BASE}/${WINDOWS_ZIP}) | Unzip anywhere and run \`whisper-smart.exe\` |

Existing macOS installs update themselves through Sparkle. On Arch, \`whisper-smart\`
from the AUR tracks this tag.
Expand Down
5 changes: 5 additions & 0 deletions windows/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target
**/*.rs.bk
__pycache__/
*.pyc
dist/
Loading
Loading