Repository navigation
ci(release): cut macOS/web build time in release pipeline - #271
Merged
Merged
Conversation
- build-darwin-amd64 now cross-compiles x86_64-apple-darwin from an Apple Silicon runner (macos-14) instead of running natively on macos-15-intel. GitHub's Intel macOS pool measured ~2x the wall-clock of the arm64 pool for this job (72m46s vs 40m52s on the last release). OpenSSL (openssl-src) and jemalloc build from source per-target already, so there's no arch-mismatch risk cross-linking. - Add a build-web-assets job that builds the web console dist/ and captcha WASM once (on ubuntu-latest) and uploads it as an artifact, instead of every one of the 4 platform jobs independently running bun install + wasm-pack + rsbuild build for identical, platform-independent output. Each platform job now downloads the artifact and sets SKIP_WEB_BUILD=1 so build.rs embeds the pre-built dist instead of rebuilding it.
📓 Changelog previewThis is what your commits will add to the generated ## [Unreleased]
### CI
- **release:** Cut macOS/web build time in release pipeline
### Fixed
- **release:** Make workflow_dispatch dry-run actually safe
- **release:** Avoid slash-containing VERSION breaking workflow_dispatch runs |
Found while trying to validate the perf changes in this PR via a
workflow_dispatch dry-run: the pipeline's own comment promises dry-run
'skip pushes, only build to verify the pipeline works', but two jobs
didn't honor that.
- create-release always ran 'gh release create', so a dry-run dispatch
against a branch would mint a real GitHub Release object named after
that branch.
- build-and-push-docker's push was hardcoded to true (unlike the
sandbox/gateway image jobs, which already gate on dry_run), so any
workflow_dispatch -- dry-run or not -- overwrote the real
ghcr.io/.../temps:beta-linux-{amd64,arm64} tags, which
create-docker-manifest then merges into the :beta channel tag
operators can pin to.
Gate both behind the same dry_run check the sandbox/gateway jobs
already use, and skip create-docker-manifest entirely on a dry-run
since its source tags won't exist.
…ch runs Found by actually running the dry-run triggered to validate the previous two commits: the run's 4 build jobs (including the cross-compiled darwin-amd64 target) all succeeded, but create-release crashed one step later -- sed: -e expression #1, char 20: unknown option to `s' VERSION=${GITHUB_REF#refs/tags/v} only strips the tag prefix on a real tag push. On workflow_dispatch, GITHUB_REF is refs/heads/<branch>, which doesn't match that prefix, so VERSION is left as the literal ref path -- e.g. 'refs/heads/perf/release-pipeline-speedup'. The embedded '/' then collides with sed's own 's/.../.../ ' delimiter in the Homebrew formula step, and would also produce an invalid (slash containing) Docker tag component in the two 'Extract version' steps that feed image tags. Same fix at all 3 sites: workflow_dispatch gets a synthetic dryrun-<run_id> version instead. Tag-push behavior is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build-darwin-amd64cross-compilesx86_64-apple-darwinfrom an Apple Silicon runner (macos-14) instead of running natively onmacos-15-intel. On the last real release (v0.1.0-beta.42), the Intel job took 72m46s vs 40m52s for the arm64 job — GitHub's Intel macOS pool is smaller/older hardware.openssl(viaopenssl-src, vendored) andjemalloc(viacc-rs) already build from source per-target, so there's no system-lib arch-mismatch risk cross-linking. Validated: the cross-compiled job completed in 42m33s in the dry-run below, and the resulting binary runs correctly.build-web-assetsjob that builds the web consoledist/+ captcha WASM once (onubuntu-latest) and uploads it as an artifact, instead of each of the 4 platform jobs independently runningbun install+wasm-pack+rsbuild buildfor identical, platform-independent output. Each platform job now downloads the artifact and setsSKIP_WEB_BUILD=1socrates/temps-cli/build.rsembeds the pre-builtdist/instead of rebuilding it. Measured redundant cost of the wasm-pack step alone (per job, last release): Linux amd64 1m55s, Linux arm64 1m33s, macOS arm64 3m19s, macOS Intel 7m26s — now paid once instead of 4x.workflow_dispatch --dry_runto validate the above (all pre-existing bugs, unrelated to the perf change, but blocking a safe/complete dry-run):create-releasealways calledgh release create, so a dry-run against a branch would mint a real GitHub Release named after that branch.build-and-push-docker'spushwas hardcodedtrue(unlike the sandbox/gateway image jobs, which already gate ondry_run), so anyworkflow_dispatch— dry-run or not — overwrote the realghcr.io/.../temps:beta-linux-{amd64,arm64}tags, whichcreate-docker-manifestthen merges into the:betachannel tag operators can pin to.VERSION="${GITHUB_REF#refs/tags/v}"(3 call sites) only strips the tag prefix on a real tag push; onworkflow_dispatchit left a/-containing branch ref inVERSION, which crashedsedin the Homebrew formula step and would've produced invalid Docker tags in the other two sites.Expected effect: total release wall-clock drops from ~72m (bounded by the old Intel job) to ~42m (bounded by the darwin jobs, both now similar), plus removes ~14min of aggregate redundant CI compute across the 4 platform jobs.
Test plan
workflow_dispatch --dry_run=true:create-release/build-and-push-docker/VERSION bugs above.Create Docker Manifestcorrectlyskipped. Confirmed via logs thatcreate-releasehit the dry-run guard and did not callgh release create. Confirmed viagh release listthat no spurious release exists on the repo.temps --versionworks on the cross-compiled macOS amd64 binary: downloaded the artifact, verified its sha256, confirmed viafileit's a genuineMach-O 64-bit executable x86_64, and ran it under Rosetta —temps-cli 0.1.0-beta.43-0d954d8 built 2026-07-10 11:16:53 UTC.