- Rush
- Rush X
- You have the permission to push to the coze-dev/coze-js repository.
- For official releases (patch/minor/major), must be published from the
main
branch
Command for publishing package versions, supporting various publishing strategies and version upgrade methods.
rush pub [options]
-v, --version <version>
: Specify the version number to publish-b, --bump-type <type>
: Version upgrade type, supports the following options:alpha
: Alpha pre-release version (e.g., 1.0.0-alpha.abc123)beta
: Beta pre-release version (e.g., 1.0.0-beta.1)patch
: Patch version for bug fixes (e.g., 1.0.0 -> 1.0.1)minor
: Minor version for new features (e.g., 1.0.0 -> 1.1.0)major
: Major version for breaking changes (e.g., 1.0.0 -> 2.0.0)
-t, --to <packages...>
: Publish specified packages and their downstream dependencies-f, --from <packages...>
: Publish specified packages and their upstream/downstream dependencies-o, --only <packages...>
: Publish only the specified packages-d, --dry-run
: Test run mode without actual execution-s, --skip-commit
: Skip Git commit step
-
Select Publishing Scope
- Use
--to
to publish specified packages and their downstream dependencies - Use
--from
to publish specified packages and their upstream/downstream dependencies - Use
--only
to publish only the specified packages
- Use
-
Version Upgrade
- Specify version: Use
--version
parameter - Specify upgrade type: Use
--bump-type
parameter - Interactive selection: When neither parameter is specified, prompts for upgrade type
- Specify version: Use
-
Confirm Publication
- Display packages to be published and version changes
- Request user confirmation to proceed
-
Execute Publication
- Update version numbers in package.json
- Generate changelog
- Create release branch
- Commit changes to Git
# Publish a single package
rush pub --only @scope/package-name
# Publish package and its downstream dependencies
rush pub --to @scope/package-name
# Publish with specific version
rush pub --only @scope/package-name --version 1.0.0
# Publish beta version
rush pub --only @scope/package-name --bump-type beta
# Dry run mode
rush pub --only @scope/package-name --dry-run
- Ensure the command is executed in the Rush monorepo root directory
- Requires appropriate Git permissions for branch creation and commits
- Changelog generation is skipped for pre-release versions (alpha/beta)
- Package publish configuration (shouldPublish) is automatically verified before publishing
- The command will modify files, and create new branches, but you need to push the branch to remote repository manually, and then create a pull request.