Skip to content

Version-lock npm publish and bundle native binaries#12

Merged
TeoSlayer merged 3 commits into
mainfrom
fix/version-locked-publish
Jun 23, 2026
Merged

Version-lock npm publish and bundle native binaries#12
TeoSlayer merged 3 commits into
mainfrom
fix/version-locked-publish

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Why

A web4 (daemon) release reached no downstream channel. npm stopped at 1.10.2 (May 19) — exactly when the publish workflows were deleted from web4. The publish workflow here had no version input, took its version from stale package.json (1.9.1), and shipped no native binaries (files didn't even include bin/; the optionalDependencies platform packages it relied on were never published to npm).

What

Rewrites publish.yml so it:

  • Adds a version workflow_dispatch input (web4's release pipeline dispatches it at the daemon tag). Keeps the legacy release: published trigger.
  • Pins package.json version to the dispatched version → version-locked to the daemon.
  • Builds + bundles native binaries per platform under bin/<os>-<arch>/ (the path src/ffi.ts resolves): libpilot.{so,dylib} from pilot-protocol/libpilot against the sibling-module checkout set, daemon binaries from web4 at the tag. Linux + darwin jobs each upload their subtree; the publish job merges them into one multi-platform package.
  • Publishes once with npm publish --provenance --access public, skipping if the version already exists (idempotent).

Also in package.json:

  • Adds bin/ to files (so the bundled binaries are actually packed).
  • Removes the optionalDependencies on pilotprotocol-{darwin,linux}-* platform packages that were never published to npm and are now redundant (binaries are bundled directly).

Requires existing secret NPM_TOKEN (present).

Part of the release fan-out (web4 + sdk-python + this).

@TeoSlayer

Copy link
Copy Markdown
Contributor Author

Verified end-to-end: dispatched this branch with version=1.12.3published pilotprotocol@1.12.3 to npm (latest), 75 MB unpacked (both platforms' native binaries bundled), with sigstore provenance attestation.

Root cause of the prior npm failures uncovered + fixed here: npm publish --provenance returned E422 because repository.url pointed at TeoSlayer/pilotprotocol while provenance expected pilot-protocol/sdk-node. Repointed repository/bugs at this repo.

@TeoSlayer TeoSlayer merged commit d06bdf6 into main Jun 23, 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