Complete guide for publishing rUvector packages to npm.
- Overview
- Prerequisites
- Publishing Process
- Version Management
- CI/CD Workflow
- Manual Publishing
- Troubleshooting
- Post-Publication
rUvector uses automated publishing via GitHub Actions. When you push a version tag, the CI/CD pipeline:
- Builds native binaries for all 5 platforms
- Publishes platform-specific packages
- Publishes the main
@ruvector/corepackage
The publishing workflow creates these npm packages:
Platform-specific packages (native binaries):
ruvector-core-darwin-arm64- macOS Apple Silicon (M1/M2/M3)ruvector-core-darwin-x64- macOS Intelruvector-core-linux-arm64-gnu- Linux ARM64ruvector-core-linux-x64-gnu- Linux x64ruvector-core-win32-x64-msvc- Windows x64
Main package:
@ruvector/core- Main package with TypeScript types and platform detection
Ensure you have npm publish permissions:
npm whoami
# Should show your npm usernameThe repository must have the NPM_TOKEN secret configured:
- Go to Settings → Secrets and variables → Actions
- Add
NPM_TOKENwith your npm authentication token - Generate token at: https://www.npmjs.com/settings/[username]/tokens
# Verify git user
git config user.name
git config user.email
# Verify remote
git remote -vAll platforms must build successfully:
# View latest build status
gh run list --workflow "Build Native Modules" --limit 1
# Or check PR directly
gh pr checks <PR-NUMBER>This is the standard workflow for releases:
# Check current build status
gh run list --limit 1All 5 platform builds should be passing:
- ✅ darwin-arm64 (Apple Silicon)
- ✅ darwin-x64 (Intel Mac)
- ✅ linux-arm64-gnu
- ✅ linux-x64-gnu
- ✅ win32-x64-msvc
# Navigate to package directory
cd npm/core
# Bump version (choose one)
npm version patch # 0.1.1 -> 0.1.2
npm version minor # 0.1.1 -> 0.2.0
npm version major # 0.1.1 -> 1.0.0
# Or manually edit package.jsonAlso update platform package versions to match:
# Edit npm/core/package.json
# Update optionalDependencies versions to matchcd /workspaces/ruvector
git add npm/core/package.json npm/package-lock.json
git commit -m "chore: bump version to X.Y.Z"
git push# Create annotated tag
git tag vX.Y.Z -a -m "Release vX.Y.Z
- Feature 1
- Feature 2
- Bug fix 3"
# Push tag to trigger publishing
git push origin vX.Y.Z# Watch workflow progress
gh run watch
# Or view in browser
gh run list --limit 1The workflow will:
- ⏳ Build all 5 platforms (~7 minutes)
- ⏳ Upload artifacts
- ⏳ Run publish job
- ✅ Publish packages to npm
# Check npm registry
npm view @ruvector/core versions
npm view ruvector-core-darwin-arm64 versions
# Or search npm
npm search @ruvectorIf you have a PR with passing builds:
# 1. Update version
npm version patch -w npm/core
# 2. Commit and push
git add -A
git commit -m "chore: bump version to X.Y.Z"
git push
# 3. Create and push tag
git tag vX.Y.Z
git push origin vX.Y.Z# 1. Merge PR to main
gh pr merge <PR-NUMBER> --squash
# 2. Pull latest
git checkout main
git pull
# 3. Create tag
git tag vX.Y.Z -a -m "Release vX.Y.Z"
git push origin vX.Y.ZWe follow Semantic Versioning:
- MAJOR (1.0.0): Breaking changes
- MINOR (0.1.0): New features, backwards compatible
- PATCH (0.0.1): Bug fixes, backwards compatible
Critical: All packages must use synchronized versions:
// npm/core/package.json
{
"version": "0.1.2",
"optionalDependencies": {
"ruvector-core-darwin-arm64": "0.1.2", // ← Must match
"ruvector-core-darwin-x64": "0.1.2", // ← Must match
"ruvector-core-linux-arm64-gnu": "0.1.2", // ← Must match
"ruvector-core-linux-x64-gnu": "0.1.2", // ← Must match
"ruvector-core-win32-x64-msvc": "0.1.2" // ← Must match
}
}For beta/alpha releases:
# Create pre-release version
npm version prerelease --preid=beta
# 0.1.1 -> 0.1.2-beta.0
git tag v0.1.2-beta.0
git push origin v0.1.2-beta.0The build workflow (.github/workflows/build-native.yml) triggers on:
-
Pull Requests to main
- Builds all platforms
- Does NOT publish
-
Pushes to main
- Builds all platforms
- Does NOT publish
-
Tags matching
v*- Builds all platforms
- PUBLISHES to npm ✅
The workflow builds for 5 platforms in parallel:
matrix:
settings:
- host: ubuntu-22.04
platform: linux-x64-gnu
- host: ubuntu-22.04
platform: linux-arm64-gnu
- host: macos-15-intel
platform: darwin-x64
- host: macos-14
platform: darwin-arm64
- host: windows-2022
platform: win32-x64-msvcThe publish job runs only on tags:
publish:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- Download all artifacts
- Copy binaries to platform packages
- Publish platform packages
- Publish main package.github/workflows/
├── build-native.yml # Main build & publish workflow
└── agentic-synth-ci.yml # Additional CI checks
If you need to publish manually (not recommended):
# Login to npm
npm login
# Verify authentication
npm whoamiYou'll need access to all 5 platforms or use cross-compilation:
# Linux x64
cargo build --release --target x86_64-unknown-linux-gnu
# Linux ARM64
cargo build --release --target aarch64-unknown-linux-gnu
# macOS Intel
cargo build --release --target x86_64-apple-darwin
# macOS ARM64
cargo build --release --target aarch64-apple-darwin
# Windows
cargo build --release --target x86_64-pc-windows-msvccd npm/core/platforms
# Publish each platform
cd darwin-arm64 && npm publish --access public
cd ../darwin-x64 && npm publish --access public
cd ../linux-arm64-gnu && npm publish --access public
cd ../linux-x64-gnu && npm publish --access public
cd ../win32-x64-msvc && npm publish --access publiccd npm/core
npm run build # Compile TypeScript
npm publish --access publicnpm error Invalid: lock file's ruvector-core-darwin-arm64@0.1.1
does not satisfy ruvector-core-darwin-arm64@0.1.2
Solution: Synchronize versions in npm/core/package.json:
# Update optionalDependencies to match platform package versions
cd npm
npm install
git add package-lock.json
git commit -m "fix: sync package versions"Error: macos-13 runner deprecated
Solution: Update workflow to use macos-15-intel:
- host: macos-15-intel # Not macos-13
platform: darwin-x64Could not find a part of the path 'D:\dev\null'
Solution: Add shell: bash to Windows-compatible steps:
- name: Find built .node files
shell: bash # ← Add this
run: |
find . -name "*.node" 2>/dev/null || truenpm error code ENEEDAUTH
npm error need auth This command requires you to be logged in
Solution:
- Verify
NPM_TOKENsecret in GitHub repository settings - Regenerate token if expired: https://www.npmjs.com/settings/[username]/tokens
- Update repository secret
npm error code E403
npm error 403 Forbidden - PUT https://registry.npmjs.org/@ruvector%2fcore
Solution:
- Verify you have publish permissions for
@ruvectorscope - Contact npm org admin to grant permissions
- Ensure package name is available on npm
Error: No files were found with the provided path: npm/core/platforms/*/
Solution:
- Check that all 5 builds completed successfully
- Verify artifact upload step succeeded
- Check artifact names match expected pattern:
bindings-{platform}
error: tag 'v0.1.2' already exists
Solution:
# Delete local tag
git tag -d v0.1.2
# Delete remote tag
git push origin :refs/tags/v0.1.2
# Create tag again
git tag v0.1.2
git push origin v0.1.2If you published the wrong version:
# Deprecate the bad version
npm deprecate @ruvector/core@0.1.2 "Incorrect version, use 0.1.3"
# Unpublish (only within 72 hours)
npm unpublish @ruvector/core@0.1.2
# Publish correct version
git tag v0.1.3
git push origin v0.1.3# Check versions
npm view @ruvector/core versions
npm view ruvector-core-darwin-arm64 versions
# Test installation
npm create vite@latest test-project
cd test-project
npm install @ruvector/core
npm run devAfter publishing:
- Update
CHANGELOG.mdwith release notes - Update
README.mdversion badges - Create GitHub Release with notes
- Update documentation site if applicable
# Using gh CLI
gh release create v0.1.2 \
--title "Release v0.1.2" \
--notes "## Changes
- Feature 1
- Feature 2
- Bug fix 3
**Full Changelog**: https://github.com/ruvnet/ruvector/compare/v0.1.1...v0.1.2"
# Or create manually at:
# https://github.com/ruvnet/ruvector/releases/new- Post on social media
- Update project website
- Notify users on Discord/Slack
- Send newsletter if applicable
Use this checklist for each release:
## Pre-Release
- [ ] All tests passing
- [ ] All 5 platform builds passing
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
- [ ] Version bumped in package.json
- [ ] Version synchronized across all packages
## Release
- [ ] Version committed and pushed
- [ ] Git tag created
- [ ] Tag pushed to trigger workflow
- [ ] Workflow completed successfully
- [ ] Packages published to npm
## Post-Release
- [ ] Verified packages on npm
- [ ] Test installation works
- [ ] GitHub Release created
- [ ] Documentation updated
- [ ] Announced release- npm Publishing Documentation
- Semantic Versioning
- GitHub Actions Documentation
- NAPI-RS Documentation
- Rust Cross-Compilation
If you encounter issues not covered in this guide:
- Check GitHub Issues
- Review GitHub Actions Logs
- Ask in Discussions
- Contact maintainers
Last Updated: 2025-11-25 Version: 1.0.0