Skip to content

feat: add cross-compile build scripts and smoke tests [2/4] - #44

Closed
wyattjoh wants to merge 1 commit into
wyattjoh/monorepofrom
wyattjoh/cross-compile
Closed

feat: add cross-compile build scripts and smoke tests [2/4]#44
wyattjoh wants to merge 1 commit into
wyattjoh/monorepofrom
wyattjoh/cross-compile

Conversation

@wyattjoh

@wyattjoh wyattjoh commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

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 via bun build --compile for 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 using file output
  • scripts/releaser/targets.ts -- single source of truth for target definitions, Bun target mappings, and verify patterns
  • build-binaries.yml -- reusable CI workflow that matrix-builds all targets on the appropriate runner OS
  • smoke-test.yml -- reusable CI workflow that runs the compiled binary on native runners to catch runtime issues (e.g. missing shared libraries) before publishing

Also extends root lint/format scripts to cover the new scripts/ directory and adds *.bun-build to .gitignore.

Merge instructions

This is part of a 4-PR stack (#43, #44, #45, #46). After squash-merging this PR:

git fetch origin main
git rebase origin/main wyattjoh/release-infra
git push --force-with-lease origin wyattjoh/release-infra

Then merge #45, and repeat.

Test plan

  • CI passes: format:check, lint, build, test
  • bun run build:compile:all completes for the local platform target
  • Review build-binaries.yml matrix against targets.ts definitions

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.
@wyattjoh

Copy link
Copy Markdown
Contributor Author

PR Stack — Supersedes #31

PR Description
1 #43 Monorepo restructure
2 #44 Cross-compile build + smoke tests — ← this PR
3 #45 Release infrastructure (changesets)
4 #46 Release documentation + LICENSE

Review in parallel, merge sequentially 1→2→3→4.
Squash-merge each PR, then rebase the next branch onto the updated base before merging it.

@wyattjoh
wyattjoh marked this pull request as draft March 20, 2026 17:08
@wyattjoh
wyattjoh deleted the branch wyattjoh/monorepo March 20, 2026 17:47
@wyattjoh wyattjoh closed this Mar 20, 2026
@wyattjoh

Copy link
Copy Markdown
Contributor Author

Replaced by #47 (base branch was deleted on merge)

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.

1 participant