This repository uses a two-workflow approach for releases:
- Update Dependencies Workflow - Handles dependency updates, API generation, and version bumping
- Release Workflow - Handles npm publishing from GitHub releases
-
Run Update Dependencies Workflow
- Go to Actions → Update Dependencies and API
- Click "Run workflow"
- Choose options:
- Version bump type: patch, minor, or major
- Update dependencies: Update all dependencies to latest versions
- Generate API: Regenerate API types from Vapi OpenAPI spec
- Click "Run workflow"
-
Review and Merge PR
- The workflow will create a PR with all updates
- Review the changes (version bump, dependency updates, API changes)
- Merge the PR to main
-
Create GitHub Release
- Go to the Releases page
- Click "Draft a new release"
- Create a tag with the format
v{VERSION}matching the version in package.json - Set the release title (e.g., "v2.3.7")
- Add release notes describing the changes
- Check "Set as a pre-release" if this is a beta/alpha release
- Click "Publish release"
-
Automated Publishing The release workflow will automatically:
- Verify the tag version matches package.json version
- Install dependencies and build the package
- Run tests (including example project)
- Publish to npm with appropriate tags:
- Production releases:
latesttag - Alpha releases:
alphatag (version must contain "alpha") - Beta releases:
betatag (version must contain "beta") - Other pre-releases:
nexttag
- Production releases:
- Trigger: Manual dispatch from GitHub Actions
- Purpose: Prepare releases by updating dependencies, generating API, and bumping versions
- Creates: Pull request with all changes ready for review
- Trigger: GitHub release published
- Purpose: Verify version and publish to npm
- Requires: Package.json version must match release tag
- Trigger: Push/PR to main
- Purpose: Ensure code compiles, tests pass, and example project builds
- Production Release:
v2.3.7 - Beta Release:
v2.4.0-beta.1 - Alpha Release:
v2.4.0-alpha.1
# Build and test example project
npm run test:example
# Create local build for testing
npm run pack:local
# Run example in development mode
npm run dev:example
# Clean up build artifacts
npm run clean-buildsIf automation fails, you can publish manually:
npm ci
npm run build
npm test
npm publish --access public- Version mismatch error: Ensure the GitHub release tag exactly matches the version in package.json
- NPM publish fails: Check that the
NPM_TOKENsecret is valid - Example project build fails: Check that the library builds correctly first
- Update workflow fails: Check the Actions tab for detailed logs
If a release has issues:
- Delete the problematic release from GitHub
- Use
npm unpublish @vapi-ai/web@{VERSION}(within 72 hours) - Fix the issues
- Run update workflow with patch version bump
- Create new release