beachball
Home
Getting started
GitHub
Home
Getting started
GitHub
  • Overview

    • Getting started
    • Installation
    • Configuration
  • Concepts

    • Bump algorithm
    • Change files
    • Change types
    • Groups
    • CI integration
    • AI integration
    • Optimizing performance in large repos
  • CLI commands

    • Common options
    • bump
    • change
    • check
    • config
    • publish
    • sync

publish

Bumps package versions, publishes to the npm registry, and pushes file updates and tags to the git remote.

Options

General options also apply for this command.

Most options can also be specified in the configuration file, which is generally preferable as it's easier to read and maintain.

OptionAliasDefaultDescription
--access'restricted'Publish access level: 'restricted' or 'public'. This should almost always be set to 'public'.
--auth-type-a'authtoken'npm auth type for NPM_TOKEN or --token: 'authtoken' or 'password'
--git-tags, --no-git-tagstrue (--git-tags)whether to create git tags for published package versions
--keep-change-filesdon't delete the change files from disk after bumping
--message-m'applying package updates'custom commit message
--prerelease-prefixprerelease prefix (e.g. beta) for packages that will receive a prerelease bump
--publish, --no-publishtrue (--publish)whether to publish to the npm registry
--push, --no-pushtrue (--push)whether to commit changes and push them back to the git remote
--registry-r'https://registry.npmjs.org'npm registry for publishing
--retries3number of retries for a package publish before failing
--tag-t'latest'dist-tag for npm publishes
--token-nNot recommended; see alternatives
--verbosefalseprints additional information to the console
--yes-yif CI detected, trueskips the prompts for publish

CI integration

See the CI integration page for details about how to handle git and npm authentication while publishing, as well as complete example workflows.

Note that if running beachball publish manually on your local machine, there's the additional option of authenticating with npm via npm login.

Publish algorithm

The publish command is designed to run steps in an order that minimizes the chances of mid-publish failure by doing validation upfront.

beachball publish performs the following steps:

  1. Validate that options and change files are valid
  2. Bump and publish to npm (unless disabled):
    1. Bump the package versions locally
    2. Generate the changelog files (unless disabled)
    3. Delete change files locally (unless disabled)
    4. Validate that the package versions to be published don't already exist in the registry and don't depend on any private packages
    5. Publish packages to npm in topological order based on the dependency graph (so if there's a failure partway through, a published package won't reference unpublished versions)
  3. Bump and push to git (unless bumping or pushing is disabled):
    1. Revert any previous changes (from the publish step)
    2. Merge the latest changes from the remote branch to avoid merge conflicts (unless fetching is disabled)
    3. Bump the versions locally
    4. Generate the changelog files (unless disabled)
    5. Delete change files locally (unless disabled)
    6. Commit the changes
    7. Create git tags for new package versions (unless disabled)
    8. Push the changes and tags

It might be surprising that beachball publish does so many steps, especially the step about reverting changes! In most version bumping systems that automate syncing the git repo and npm registry, they assume that the source code is still fresh once it's time to push changes back to the git repository. This is rarely the case for large repos with many developers. So, beachball fetches the latest changes before pushing back to the target branch to avoid merge conflicts.

Recovering from failed publish

If the publish command fails partway through, after some versions have been published to the registry, you'll need to run beachball sync and commit the changes.

Last Updated: 6/25/26, 12:40 AM
Contributors: renovate[bot]
Prev
config
Next
sync