Repository navigation
Commit b47a31a
authored
ci: migrate workflows to Blacksmith (#1249)
* ci: migrate workflows to Blacksmith
Move CI, release preparation, scheduled automation, and lightweight gate jobs onto Blacksmith runners. Keep macOS Intel and Windows ARM only in the release native package matrix because those runner families are not available on Blacksmith.
Replace nix-community/cache-nix-action with a pinned useblacksmith/stickydisk mount for the Linux /nix store, using stable package/dev keys per runner architecture so Nix builds reuse persistent store state on every Blacksmith Linux job.
Replace the old GitHub Actions cache cleanup workflow with weekly Blacksmith sticky disk Nix garbage collection for package and dev profiles, deleting store paths older than seven days.
Split npm release publishing so Blacksmith restores native artifacts and packs npm tarballs, while the final GitHub-hosted job only runs pnpm publish with provenance for OIDC trusted publishing.
* ci: harden Blacksmith workflow credentials
Address CodeRabbit feedback by avoiding persisted checkout credentials in release/cache maintenance jobs, disabling setup-node package-manager caching in the OIDC publish job, and tightening the temporary /nix mount point permission before stickydisk mounts.
* ci: share Nix sticky disks per platform
Remove the cache-profile input from the setup-nix action so each OS and architecture uses one shared /nix sticky disk. The Nix store is content-addressed and safe to share within the platform scope, so keeping separate package and dev profiles only fragments the cache and doubles GC work.
Simplify the weekly sticky disk GC matrix to match the shared Linux platform keys. Restore the npm publish job shape to the existing GitHub-hosted OIDC publishing flow; only the native package build jobs need the Blacksmith runner migration.
* ci: tighten Blacksmith workflow migration
Switch the PR gate away from pull_request_target so the contributor gate no longer runs as a privileged target workflow. It stays on the lightweight Blacksmith runner because the job does not need a larger machine.
Enumerate the Blacksmith labels in actionlint so typos are caught during workflow linting. Limit the PR preview package publish to the native packages actually built on PRs; release still builds and publishes the full platform set.
Keep npm release publishing on the existing GitHub-hosted OIDC path. For sticky disk Nix setup, fix mounted /nix ownership after the disk is attached so the single-user Nix installer can write to the store without using a world-writable mount point.
* ci: fix sticky disk mounts
Remove the unsupported commit input from the pinned useblacksmith/stickydisk action and recreate /nix/store after the sticky disk is mounted before fixing ownership. The mounted filesystem can replace the pre-created directory tree, so /nix/store must be created after mount to avoid Linux ARM setup failures.
Drop the remaining actions/cache based Cargo cache from Windows native package builds. The Blacksmith sticky disk action is documented as an ext4 mounted disk and the pinned implementation shells out to mkfs.ext4 and mount, so Windows native runners cannot safely use it as a direct replacement.
Restore action-timeline to the main-branch ubuntu-slim runner because that reporting job does not need Blacksmith capacity.
* ci: keep lightweight jobs on ubuntu-slim
Restore the lightweight PR gate, issue gate, contributor approval, PR title, code-change detection, and action timeline jobs to the GitHub-hosted ubuntu-slim runner. These jobs only run small GitHub API or reporting work and do not benefit from Blacksmith capacity.
Keep the actionlint Blacksmith runner allow-list limited to the heavy runners that remain in use after moving lightweight jobs back to ubuntu-slim.
* ci: harden release workflow credentials
Disable persisted checkout credentials in the npm publish and release jobs, and disable setup-node package manager caching in the npm publish job. This keeps the existing GitHub-hosted OIDC publish flow intact while addressing CodeRabbit credential and cache-poisoning findings.
Remove the global SC2016 actionlint suppression and scope the shellcheck directive to the two inline Node.js command substitutions that intentionally use single-quoted JavaScript.
* ci: restore Windows Cargo cache
Restore actions/cache for Windows Cargo builds in CI and release. Blacksmith documentation says official GitHub cache actions transparently use Blacksmith colocated cache on Blacksmith runners and recommends upstream cache actions over archived useblacksmith cache forks.
Do not use useblacksmith/stickydisk for Windows Cargo because the sticky disk documentation describes ext4 filesystem mounts and the pinned action implementation formats and mounts ext4 block devices. Nix store caching remains on sticky disk as requested.
* ci: cache node modules on Blacksmith
Mount the root node_modules directory on a Blacksmith sticky disk for Linux jobs that use setup-nix. The sticky disk key includes the pnpm version from package.json plus runner OS and architecture so dependency layout changes from a pnpm upgrade do not reuse the old disk.
Gate sticky disk mounts on the Blacksmith sticky disk token so GitHub-hosted jobs continue to use normal setup. Add a macOS /nix cache inside setup-nix using the upstream cache action because the sticky disk action is Linux/ext4 oriented.
* ci: restore macOS Nix cache action
Use nix-community/cache-nix-action for macOS Nix store caching instead of a raw /nix actions/cache restore. The original Nix cache action handles the store safely on macOS, while Linux Blacksmith jobs continue to use sticky disk for /nix.
Keep the cache key shared per OS and architecture without reintroducing the old package/dev cache profile split.
* ci: fix macOS Nix cache gc input
Use gc-max-store-size-macos for the macOS nix-community/cache-nix-action path. The previous Linux-specific input was ignored on macOS, so the cache save path would not run the intended size-based store GC.
* ci: rotate Windows Cargo cache saves
Include the workflow run id and attempt in the Windows Cargo cache primary key so actions/cache saves updated cargo registry, git, and target contents after each build. Keep lockfile/toolchain-scoped restore keys first so runs still restore from the nearest compatible cache.
* ci: stabilize preview package e2e
Restore the Nix store before macOS preview E2E runs so the Nix-built native package can find its linked store libraries in CI. This keeps the Blacksmith macOS preview check aligned with the native package build environment.
Disable pnpm minimumReleaseAge for preview-package dlx checks. The E2E intentionally installs just-published pkg.pr.new and npm packages, so the workspace-wide age gate rejects valid fresh preview dependencies.
* fix(nix): detach darwin binary from nix libiconv
Rewrite the Darwin ccusage binary install name from the Nix-provided libiconv path to the macOS system libiconv path during package installation.
This keeps Nix as the release build environment while producing a package that runs on macOS machines without the corresponding /nix/store path. The preview package E2E no longer installs Nix on macOS, so it continues to verify the distributed package in a clean runtime environment.
Fixes #1251
* ci: split native package build actions
Move the native package build flow out of duplicated CI and release workflow steps into platform-specific composite actions for Linux, macOS, and Windows.
Keep Blacksmith StickyDisk setup isolated to the Linux setup action, keep macOS on the original Nix cache action, and keep Windows Cargo cache setup separate so each platform path is easier to audit.
* ci: build intel mac package without nix
Keep macOS ARM on the Nix build path, where the Blacksmith runner is fast enough and the macOS Nix cache is useful.
Build the release-only Intel macOS package with Cargo instead, matching the Windows native package path and avoiding slow GitHub-hosted Intel mac Nix setup and cache behavior.
* ci: split macos native build actions
Replace the macOS build action input switch with separate Nix and Cargo composite actions.
The CI macOS ARM build continues to use the Nix action, release macOS ARM uses the same path, and release Intel macOS calls the Cargo action so it avoids slow Nix setup and cache behavior on the GitHub-hosted Intel runner.
* ci: avoid template expansion in native actions
Pass composite action inputs through environment variables before shell execution so zizmor does not treat arch and binary values as attacker-controllable template injection.1 parent caab151 commit b47a31a
16 files changed
Lines changed: 379 additions & 194 deletions
File tree
- .github
- actions
- build-linux-native-package
- build-macos-cargo-native-package
- build-macos-nix-native-package
- build-windows-native-package
- setup-linux-blacksmith-sticky-disk
- setup-macos-nix-cache
- setup-native-build-cache
- setup-nix
- workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 20 | + | |
| 21 | + | |
45 | 22 | | |
46 | 23 | | |
47 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
17 | 24 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments