bunli release command automates the release process for your CLI. It handles version bumping, building, testing, git tagging, npm publishing, and GitHub releases.
Usage
Basic Examples
Options
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
--version | -V | 'patch' | 'minor' | 'major' | string | - | Version to release (patch/minor/major/x.y.z) |
--tag | -t | string | - | Git tag format |
--npm | - | boolean | - | Publish to npm |
--github | - | boolean | - | Create GitHub release |
--dry | -d | boolean | false | Dry run - show what would be done |
--all | - | boolean | false | Release all packages (workspace mode) |
Release Workflow
The release command executes these steps:- Run tests - Ensures all tests pass
- Update version - Bumps version in package.json
- Build project - Runs
bun run build - Publish platform packages (if binary release)
- Create git tag - Tags with version
- Publish to npm (if enabled)
- Create GitHub release (if enabled)
Implementation
Version Bumping
Interactive Version Selection
Without--version, the command prompts:
Semantic Versioning
Git Integration
Working Directory Check
Ensures working directory is clean:Creating Git Tags
Tag Format
Customize tag format:NPM Publishing
Standard Publishing
Binary Releases
Bunli supports binary releases with platform-specific packages:Configuration
How Binary Releases Work
- Build platform binaries using
bunli build --targets - Create platform packages for each binary
- Publish platform packages to npm
- Generate shim script that selects correct binary
- Update main package with optionalDependencies
Platform Packages
@mycli/mycli-darwin-arm64@mycli/mycli-linux-x64@mycli/mycli-windows-x64
Shim Generation
The shim script selects the correct binary at runtime:Optional Dependencies
The main package lists platform packages as optional:Supported Platforms
GitHub Releases
Create GitHub releases using the GitHub CLI:Conventional Commits
Use conventional commit format for release commits:- With conventional commits:
chore(release): v1.0.0 - Without:
chore: release v1.0.0
Configuration
Complete release configuration:Dry Run
Test the release process without making changes:- Runs tests
- Shows version changes
- Simulates npm publish
- Skips git operations
- Restores package.json after completion
Output Example
Troubleshooting
Private Package Error
"private": true from package.json or disable npm publishing:
Dirty Working Directory
GitHub CLI Not Found
Install GitHub CLI or disable GitHub releases:Binary Release with Compression
compress: false in your build config.
See Also
- Building - Build configuration for releases
- Configuration - Release configuration options