feat: add cross-compile build scripts and smoke tests [2/4] - #44
Closed
wyattjoh wants to merge 1 commit into
Closed
Conversation
Add scripts to cross-compile the CLI binary for 8 platform targets (linux/darwin/windows × x64/arm64), plus reusable CI workflows for building and smoke-testing binaries across stable/canary/snapshot channels.
This was referenced Mar 20, 2026
Contributor
Author
|
Contributor
Author
|
Replaced by #47 (base branch was deleted on merge) |
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
#43 sets up the monorepo with a wrapper shim that resolves platform-specific binaries, but we can only build a binary for the local machine today. To actually ship
npx clerk, we need to produce binaries for every platform users run on.This PR adds the cross-compilation pipeline:
scripts/build.ts-- compiles the CLI viabun build --compilefor 8 platform targets (darwin-arm64, darwin-x64, linux-arm64, linux-arm64-musl, linux-x64, linux-x64-musl, windows-x64, windows-arm64), with binary format verification usingfileoutputscripts/releaser/targets.ts-- single source of truth for target definitions, Bun target mappings, and verify patternsbuild-binaries.yml-- reusable CI workflow that matrix-builds all targets on the appropriate runner OSsmoke-test.yml-- reusable CI workflow that runs the compiled binary on native runners to catch runtime issues (e.g. missing shared libraries) before publishingAlso extends root lint/format scripts to cover the new
scripts/directory and adds*.bun-buildto.gitignore.Merge instructions
This is part of a 4-PR stack (#43, #44, #45, #46). After squash-merging this PR:
Then merge #45, and repeat.
Test plan
format:check,lint,build,testbun run build:compile:allcompletes for the local platform targetbuild-binaries.ymlmatrix againsttargets.tsdefinitions