Skip to content

Automate prebuilt npm releases#14

Merged
benvinegar merged 1 commit intomasterfrom
feat/prebuilt-npm-release-workflow
Mar 21, 2026
Merged

Automate prebuilt npm releases#14
benvinegar merged 1 commit intomasterfrom
feat/prebuilt-npm-release-workflow

Conversation

@benvinegar
Copy link
Member

Summary

  • add the actual GitHub Actions release workflow for publishing prebuilt npm packages
  • generalize prebuilt package staging from one host build to a multi-artifact release assembly flow
  • add publish/retry helpers so platform packages publish before the top-level hunkdiff package

What this changes

This takes the prebuilt-binary work past the prototype stage from #12.

New release workflow

.github/workflows/release-prebuilt-npm.yml now:

  • builds binaries on:
    • ubuntu-latest -> hunkdiff-linux-x64
    • macos-13 -> hunkdiff-darwin-x64
    • macos-14 -> hunkdiff-darwin-arm64
  • uploads each platform binary as an artifact
  • downloads all build artifacts into one staging job
  • verifies that a tag like v0.3.0 matches package.json
  • stages the publishable npm package directories from those artifacts
  • verifies the staged tarballs
  • dry-runs publish order in CI
  • publishes to npm on tag pushes or manual workflow dispatch with publish=true

New scripts

  • scripts/build-prebuilt-artifact.ts
    • packages the current host binary into an artifact directory for CI fan-in
  • scripts/stage-prebuilt-npm.ts
    • now supports staging from dist/release/artifacts instead of only the local host build
  • scripts/check-release-version.ts
    • ensures release tags match package.json
  • scripts/publish-prebuilt-npm.ts
    • publishes staged platform packages first, then the top-level package
    • skips already-published versions so reruns can recover from partial publishes
  • scripts/check-prebuilt-pack.ts
    • verifies all staged platform packages, not just the current host package

Packaging tweaks

  • narrow the first actual published prebuilt matrix to:
    • hunkdiff-linux-x64
    • hunkdiff-darwin-x64
    • hunkdiff-darwin-arm64
  • platform packages now publish only the binary payload; the top-level meta package owns the hunk bin entry

Validation

  • bun run typecheck
  • bun test
  • bun run test:tty-smoke
  • bun run check:pack
  • bun run build:prebuilt:npm
  • bun run check:prebuilt-pack
  • bun run smoke:prebuilt-install
  • bun run build:prebuilt:artifact
  • bun run stage:prebuilt:release
  • bun run check:prebuilt-pack
  • bun run publish:prebuilt:npm -- --dry-run

Follow-up

Once this lands, the next real release can go through the prebuilt workflow instead of publishing the Bun-backed root package from the repo root.

@benvinegar benvinegar merged commit 236c742 into master Mar 21, 2026
9 checks passed
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