New releases of the @mdn/browser-compat-data NPM package are usually published once per week or more often around browser releases.
The release process is mostly automated using two GitHub workflows:
- The
release-prworkflow manages a pull request that bumps thepackage.jsonversion and updates the release notes. - The
releaseworkflow creates the GitHub release and tag, publishes the release on NPM, and triggers MDN deployment.
The release itself is triggered manually, to help ensure that as many ready pull requests make it into the release.
Any project owner (or release designee) can complete the following steps to publish a new version.
To publish a release:
- If this is a major or minor release: Align with project owners on the release notes entries, i.e. "Breaking changes" for major releases, and "Notable changes" for major/minor releases.
- Mark the release pull request (titled
Release vX.Y.Z) as ready for review. - Ensure that the pull request is up-to-date, i.e. that all checks have passed on the latest
maincommit, and that no other pull request is merged right before. - If this is a major or minor release: Add the release notes entries manually to the
RELEASE_NOTES.mdon thereleasebranch (below the release date). - Merge the pull request.
The release pull request is managed by the release-pr workflow, which runs npm run release with a personal access token (PAT) that is owned by @mdn-bot, and has read and write access to code and pull requests on the repository.
The release script performs the following steps:
- Fetches the latest
mainbranch. - Determines the previous release version.
- Determines whether a major or minor version bump is needed, based on pull requests with the
semver-major-bumporsemver-minor-bumplabel merged since the previous release. - Updates the
package.jsonby runningnpm version. - Updates the
RELEASE_NOTES.mdby determining release notes based on the following input:- Release and repository statistics.
- List of added and removed features, determined by iterating over all merged pull requests since the previous release, and enumerating all features before and after the merge commit.
- Commits and pushes the changes to the
releasebranch. - Creates or updates the release pull request accordingly.
Merging the release pull request yields the following result:
- The merge commit triggers the
create-releasejob of thereleaseworkflow workflow. - The
create-releasejob publishes a GitHub release and tag based on the updatedpackage.jsonand release notes. - The published GitHub release triggers the
publish-releasejob of thereleaseworkflow. - The
publish-releasejob performs the following steps:- Builds the release.
- Publishes the release to NPM.
- Adds the
data.jsonas an asset to the GitHub release. - Dispatches a
bcd_releaseevent on the mdn/bcd-utils repository, which triggers the deployment of the new BCD release on MDN.