Skip to content

feat(cli): publish native CLI to npm on tag push#1944

Open
ZaynJarvis wants to merge 1 commit intomainfrom
feat/npm-publish
Open

feat(cli): publish native CLI to npm on tag push#1944
ZaynJarvis wants to merge 1 commit intomainfrom
feat/npm-publish

Conversation

@ZaynJarvis
Copy link
Copy Markdown
Collaborator

Summary

  • Replace GitHub Release with npm publishing for CLI tags (cli@*)
  • Each tag triggers: build 5 platform binaries → publish platform-specific @openviking/cli-{os}-{arch} packages → publish @openviking/cli wrapper
  • Add npm/cli/ wrapper package with JS shim that loads platform-specific native binary + postinstall help message
  • Remove GitHub Release and artifact upload steps from CLI workflow

Required GitHub secret

NPM_TOKEN — npm automation token with publish access to the @openviking org. Must have 2FA bypass enabled (granular access token).

How it works

  1. Push a tag like cli@0.3.15
  2. CI builds the Rust CLI for 5 platforms (linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64)
  3. Each platform binary is packaged into @openviking/cli-{platform} with proper os/cpu fields
  4. All 5 platform packages are published to npm
  5. The wrapper @openviking/cli package is published with version injected from the tag and optionalDependencies pointing to the platform packages

Install flow

npm i -g @openviking/cli
# npm automatically picks the right platform binary via optionalDependencies
ov --version

Test plan

  • Configure NPM_TOKEN in GitHub repo secrets
  • Push a test tag (e.g., cli@0.3.15) and verify all 6 packages publish
  • Verify npm i -g @openviking/cli installs correctly on macOS and Linux

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🏅 Score: 90
🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

Replace GitHub Release with npm publishing for CLI tags (cli@*).
Each tag triggers: build 5 platform binaries → publish platform-specific
@openviking/cli-{os}-{arch} packages → publish @openviking/cli wrapper.

- Add npm/cli/ wrapper package with postinstall help message
- Generate platform packages in CI from build artifacts
- Remove GitHub Release and artifact upload from CLI workflow

Required GitHub secret: NPM_TOKEN

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant