Skip to content

ci: add Windows and Linux canary workflows with caching#2642

Open
wpfleger96 wants to merge 4 commits into
mainfrom
wpfleger/windows-linux-canary-workflows
Open

ci: add Windows and Linux canary workflows with caching#2642
wpfleger96 wants to merge 4 commits into
mainfrom
wpfleger/windows-linux-canary-workflows

Conversation

@wpfleger96

@wpfleger96 wpfleger96 commented Jul 23, 2026

Copy link
Copy Markdown
Member

Adds windows-canary.yml and linux-canary.ymlworkflow_dispatch jobs that produce unsigned installable artifacts (.exe NSIS installer, .deb + .AppImage) from any ref without touching the release pipeline. Also retrofits signed-macos-canary.yml with Rust and pnpm caching so all three canary builds warm quickly on repeat dispatches.

What this adds

windows-canary.ymlwindows-latest runner, rust-toolchain.toml in the repo root pins the toolchain via preinstalled rustup (rustup target add to register the MSVC target), pnpm install --frozen-lockfile, sidecars cargo build --release, pnpm tauri build --bundles nsis with createUpdaterArtifacts:false. Uploads the NSIS .exe as artifact buzz-windows-canary-<source-sha>, 7-day retention. No mesh-llm (release-windows doesn't build it).

linux-canary.yml — same ubuntu:22.04 container as the release job, same apt deps block, pinned appimagetool 1.9.1 + type2-runtime 20251108, hermit, mold, just desktop-install-ci, sidecars, pnpm tauri build --bundles deb,appimage. Runs fix-appimage.sh without signing env vars (the script detects their absence and skips re-signing; repacking still removes the Mesa/GLib/GStreamer conflict libs). Uploads .deb + .AppImage as buzz-linux-canary-<source-sha>, 7-day retention.

signed-macos-canary.yml — adds Swatinem/rust-cache (workspace root + desktop/src-tauri) and the pnpm store restore/save pattern. The existing mesh-llama cache is unchanged.

Design decisions vs. signed-macos-canary.yml

The macOS canary has a Require main guard because it runs OIDC signing/notarization — the OIDC token scope is tied to the ref. The Windows and Linux canaries are contents: read, unsigned, and zero-secrets, so building arbitrary refs is safe and is the entire point: pre-merge Windows/Linux testing without local toolchains.

Caching rationale

  • Rust: Swatinem/rust-cache with workspaces: . \n desktop/src-tauri covering both the sidecar --release build and the Tauri build. shared-key scoped to <platform>-canary-release — canary runs warm each other without colliding with CI's debug-profile keys (CI Windows runs clippy/check, not --release).
  • pnpm: explicit store restore/save pattern from ci.yml:149-196. Restores are unconditional (a cold miss is safe). Saves are conditional: workflow_dispatch executes on the dispatch ref, so github.ref/github.sha stay main-scoped even when inputs.ref checks out a feature branch. Without a guard, a dispatch from main with a non-main inputs.ref and an unchanged lockfile would write into the main-scoped pnpm cache under the same key as CI — a cache-poisoning path. The actions/cache/save step and the rust-cache save-if both require github.ref == 'refs/heads/main' && inputs.ref == 'main'. signed-macos-canary.yml is unaffected (its main-only guard makes all saves trusted).
  • mold: rui314/setup-mold on Linux to reduce link time, matching the Linux Rust CI jobs.
  • timeout-minutes: 60 on all three — generous enough for the cold path.

Artifact provenance

github.sha stays the dispatch-ref (main) SHA regardless of inputs.ref. A "Capture source SHA" step immediately after checkout resolves git rev-parse HEAD into a step output; artifact names and log lines use that resolved SHA so an artifact built from a feature branch is unambiguously named.

Zizmor hygiene

All three workflows: every action pinned by full commit SHA (matching ci.yml/release.yml pins), persist-credentials: false on checkouts, top-level permissions: contents: read, no ${{ }} interpolation directly in run: bodies (env-var indirection throughout), if: github.repository == 'block/buzz' on jobs, ref input flows through actions/checkout ref:.

Adds windows-canary.yml and linux-canary.yml — workflow_dispatch builds
that produce unsigned installable artifacts (NSIS .exe, .deb + .AppImage)
from any ref without touching the release pipeline.

Also retrofits signed-macos-canary.yml with the same caching (Rust +
pnpm) so all three canary builds warm quickly on repeat dispatches.

Key design decisions:
- Both new workflows accept a ref input (default: main); no Require-main
  guard needed because they are unsigned, contents:read, and zero-secrets.
  The macOS canary requires main because it runs OIDC signing/notarization.
- Rust cache uses Swatinem/rust-cache with workspaces covering both the
  workspace root (sidecar --release builds) and desktop/src-tauri (Tauri
  build). shared-key is scoped per platform + canary-release so dispatched
  runs share cache without colliding with CI's debug-profile keys (CI
  Windows does clippy/check, not --release).
- pnpm caching uses the explicit store restore/save pattern from ci.yml
  (not setup-node package-manager-cache) for consistency across all three
  canaries. Safe here because all three jobs are contents:read and
  artifact-only; release-windows disables pnpm caching because that job
  is contents:write feeding a signed installer (cache poisoning vector).
- Linux job mirrors release-linux: same ubuntu:22.04 container + apt deps,
  pinned appimagetool 1.9.1 + type2-runtime 20251108, rui314/setup-mold
  for faster link times, fix-appimage.sh run without signing env vars
  (script guards on TAURI_SIGNING_PRIVATE_KEY and skips re-signing when
  absent — repacking still removes the Mesa/GLib/GStreamer conflict libs).
- createUpdaterArtifacts: false in all canary configs; no signing keys,
  updater endpoints, or GitHub Release machinery required.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96
wpfleger96 requested a review from a team as a code owner July 23, 2026 22:51
Comment thread .github/workflows/windows-canary.yml Fixed
Comment thread .github/workflows/linux-canary.yml Fixed
Comment thread .github/workflows/windows-canary.yml Fixed
Comment thread .github/workflows/windows-canary.yml Fixed
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 and others added 3 commits July 23, 2026 18:58
rust-toolchain.toml pins channel = 1.95.0; windows-latest runners ship
with rustup preinstalled and honor it automatically. The dtolnay action
is unnecessary here and triggers a zizmor impostor-commit error because
its SHA cannot be verified through normal git history traversal.

Matches the pattern used by the ci.yml windows-rust job, which also
relies on the preinstalled rustup without the dtolnay action.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
SHA df4cb1c069e1874edd31b4311f1884172cec0e10 is exactly tag v6.0.3;
update the comment in all three canary files to match so zizmor's
ref-version-mismatch audit passes cleanly.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
workflow_dispatch executes on the dispatch ref, so github.ref/github.sha
stay main-scoped even when inputs.ref checks out a feature branch. Without
a guard, a dispatch from main with a non-main inputs.ref and an unchanged
lockfile writes into the main-scoped pnpm and Rust cache namespaces under
the same keys as CI — a cache-poisoning path.

Fix in windows-canary.yml and linux-canary.yml:
- rust-cache: add save-if that requires both github.ref == refs/heads/main
  and inputs.ref == main; restores stay unconditional
- pnpm actions/cache/save: same if: condition
- add Capture source SHA step (git rev-parse HEAD → step output) after
  checkout; use steps.source.outputs.sha in artifact names and env-var
  indirection (SOURCE_SHA) in run: bodies for the log line
- update file header comments to explain the cache safety model

signed-macos-canary.yml is unchanged (its main-only guard makes all cache
saves trusted by construction).

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96
wpfleger96 enabled auto-merge (squash) July 23, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants