Skip to content

How to publish the npm package for a new version

MCatherine edited this page Jun 29, 2023 · 5 revisions

Please note: there is no need to change the version in the package.json file

1. Create a pull request for your changes

The first step is to create a pull request and merge it to main for your changes. We use Release Please for release management, so all the pull request name needs to follow the naming convention. For example: "fix: #8 fix landing page style".

2. Create a Release

The second step is to create a new release for a new version. We use Release Please to create releases. This is a GitHub action that monitors the changes to the repository and maintains a Pull Request. The Pull Request that is maintained by Release Please keeps a tidy list of the changes since the last release.

Once you merged your pull request to main in step 1, release please will automatically create a pull request to monitor the changes from the last version. Merge that Release Please pull request to main to create a new release.

3. Trigger the Publish to npm Registry Github Action

Once the release please pipeline run finished, and a new release tag is created. Go to the GitHub action "Publish to npm Registry", trigger the action from the latest tag (this action only works with GitHub version tag), it will automatically publish the npm package for the latest version.