This package is published to NPM. The process to release to NPM should be started when all pull requests intended for publishing have been merged and the software has been fully tested for publication. You can release either using GitHub Actions or locally.
patch
: for non-breaking changes/bugfixes and small updates.minor
: for some new features, bug fixes, and other non-breaking changes.major
: for breaking changes.
Publishing via the GitHub Action requires that the NPM_TOKEN
be set correctly in GitHub Actions secrets. This should be an npm token generated for a bot user on the npm @automattic org that has publish access to this repo.
This is the preferred method for pushing out the latest release. The workflow runs a bunch of validations, generates a build, bump versions + tags, pushes out to npm, and bumps to the next dev version.
- Initiate the release process here.
- On the right-hand side, select "Run Workflow".
- Pick your preferred version bump.
- Click
Run Workflow
. - Wait for a pull request to appear. The pull request will update the version number and shall be assigned to you.
- When ready, merge the pull request. This will lead to a new version to be published on npmjs.com.
- Another pull request will be created to bump to a development version, also assigned to you. Merge it to finish the process.
Follow these steps to publish locally:
- Make sure you have NPM access to our @Automattic organization. Ask for #vip-platform-pâtisserie help in case you need it.
- Pull all the changes to your local
trunk
branch. Make sure you have the latest changes (git pull
). - We follow the https://semver.org/ versioning. You should run the specific version you are trying to publish:
npm version major|minor|patch
- You should see a version bump in the package.json file.
- Build the application:
npm run build
- Publish the application
npm publish
Note: You need to have two-factor enabled in your npm account. The publish command will request a two-factor code to complete the publishing process. You can also add --otp=CODE
to the npm publish
command if you already have the code.
- Push the tags to the repository and trunk updates.
git push --tags
git push origin trunk
- For major versions or breaking changes, it's recommended to create a RELEASE with the published tag.
Ps: Add a BREAKING CHANGES
section to the release. This will avoid folks trying to figure out why their code is not working on the VIP Dashboard or any other system.
If you released a broken version, ensure to inform in the GitHub release entry about the breaking change, and follow the instructions provided by NPM in: Deprecating and undeprecating packages or package versions .