Skip to content

feat(js-host-api): add npm publishing workflow#36

Open
simongdavies wants to merge 3 commits intomainfrom
feat/npm-publish
Open

feat(js-host-api): add npm publishing workflow#36
simongdavies wants to merge 3 commits intomainfrom
feat/npm-publish

Conversation

@simongdavies
Copy link
Copy Markdown
Contributor

Summary

Adds cross-platform npm publishing for @hyperlight/js-host-api.

Changes

  • npm-publish.yml - New workflow that builds native binaries on Linux/Windows and publishes to npmjs.com
  • CreateRelease.yml - Calls npm-publish after creating GitHub release
  • package.json - Added napi targets and optionalDependencies for platform packages
  • npm/ - Platform-specific package.json files for Linux and Windows
  • .npmignore - Controls what gets published (includes generated index.js/index.d.ts)
  • README.md - Added publishing documentation

Usage

  • Manual: Actions → "Publish npm packages" → Run workflow (with optional dry-run)
  • Automatic: Triggers after CreateRelease on release/vX.Y.Z branches

Setup Required

Add NPM_TOKEN secret (npm access token with publish permissions for @hyperlight scope)

@simongdavies simongdavies added the kind/enhancement New feature or improvement label Mar 3, 2026
jprendes
jprendes previously approved these changes Mar 4, 2026
Copy link
Copy Markdown
Contributor

@jprendes jprendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it would be great if we could test it in a local repo before publishing to npm, to make sure that it works as expected. There is a lot of nodejs magic in here :-)

- Add npm-publish.yml workflow for cross-platform builds (Linux/Windows x64)
- Add platform-specific npm packages for native binaries
- Integrate npm publish into CreateRelease workflow
- Add .npmignore to control published files
- Update README with publishing documentation
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an npm publishing pipeline for @hyperlight/js-host-api, including platform-specific binary sub-packages and documentation, and wires publishing into the release workflow.

Changes:

  • Introduces a new GitHub Actions workflow to build Linux/Windows N-API binaries and publish main + platform npm packages.
  • Updates @hyperlight/js-host-api metadata and adds platform package manifests under src/js-host-api/npm/.
  • Adds .npmignore rules and README documentation describing the publishing process.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/js-host-api/package.json Adds repository metadata, napi targets, and optionalDependencies for platform packages.
src/js-host-api/package-lock.json Updates lockfile to reflect new optional dependencies (currently incomplete vs package.json).
src/js-host-api/npm/win32-x64-msvc/package.json New Windows platform package manifest for the .node binary.
src/js-host-api/npm/linux-x64-musl/package.json New Linux musl platform package manifest for the .node binary.
src/js-host-api/npm/linux-x64-gnu/package.json New Linux glibc platform package manifest for the .node binary.
src/js-host-api/README.md Documents automated/manual npm publishing and platform selection behavior.
src/js-host-api/.npmignore Adds publish-time include/exclude rules (currently missing an exclusion for npm/).
.github/workflows/npm-publish.yml New workflow to build artifacts and publish npm packages (contains a critical input reference issue).
.github/workflows/CreateRelease.yml Calls the npm publish workflow after creating a GitHub release and passes the derived version.
Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants