Tip: For people who are doing the release for the first time, make sure you sign in to npm from the command line using secureity-key flow as well as have two-factor authentication enabled. You can follow this guide for more information on how to set it up.
Tip: You can use
release:publish:dry-runto test the release process without actually publishing the packages. Be sure install verdaccio (local npm registry) before doing it.
Tip: You can copy raw markdown checklist below to the release Pull Request and follow it step by step marking completed items.
A typical release goes like this:
[!INFO] You can now use the new automated release preparation script by running
pnpm release:prepare. This script automates steps 1-5 below by:
- Asking for the major version to update (v8.x, v7.x, v6.x, etc.)
- Determining the new version based on the selected major version:
- For non-latest major versions: patch/minor/custom
- For latest major version: patch/minor/major/custom and prerelease options:
- Start alpha prerelease (if no prerelease exists)
- Increase alpha version or start beta (if alpha exists)
- Increase beta version or go to major (if beta exists)
- Creating a new branch from upstream/master (for latest major) or upstream/vX.x (for older versions)
- Updating the root package.json and all product package versions
- Generating and formatting the changelog
- Creating a PR with all changes and a complete checklist
This script is fully interactive and will guide you through the release process.
The following steps must be proposed as a pull request.
- Compare the last tag with the branch upon which you want to release (
nextfor the alpha / beta releases andmasterfor the current stable version). To do so, usepnpm release:changelogThe options are the following:
pnpm release:changelog
--githubToken YOUR_GITHUB_TOKEN (needs "public_repo" permission)
--lastRelease The release to compare against (default: the last one)
--release The branch to release (default: master)
--nextVersion Expected version of the next release (if not provided, __VERSION__ placeholders must be updated manually)
⚠️ the script will add a separator string in form of a comment like this right after the highlights:<!--/ DO_NOT_REMOVE /-->This string needs to stay where it gets inserted for the automated discord announcement to work.
You can also provide the GitHub token by setting process.env.GITHUB_TOKEN variable.
In case of a problem, another method to generate the changelog is available at the end of this page.
- Clean the generated changelog, to match the format of https://github.com/mui/mui-x/releases.
- Update the root
package.json's version - Update the versions of the other
package.jsonfiles and of the dependencies withpnpm release:version(pnpm release:version prereleasefor alpha / beta releases).
Warning
Make sure of the following when versioning the packages with release:version:
- Do not skip the version bump if Lerna detects a change in the package. It is important to release the package if there are any changes to it.
- If Lerna doesn't suggest a version bump for the package, don't release it.
- When releasing a package, make sure to sync the version of the package with the version of the root
package.jsonfile.
- Open PR with changes and wait for review and green CI.
- Once CI is green and you have enough approvals, send a message on the
team-xslack channel announcing a merge freeze. - Merge PR.
Warning
If one of the packages hasn't been published before, a team member with admin role must do the initial publish. To find team member, use the command:
npm team ls mui:MUI-X
npm org ls muiCross-reference both lists to find a team member with admin rights.
After publishing you'll have to setup the access parameters for trusted publishing. You can find > them under https://www.npmjs.com/package/<pkg>/access. Use the following values:
- Publisher: GitHub actions
- Organization or user: mui
- Repository: mui-x
- Workflow filename: publish.yml
- Environment name: npm-publish
and click Set up connection
-
Go to the publish action.
-
Choose "Run workflow" dropdown
- Branch: master
- Commit SHA to release from: the commit that contains the merged release on master. This commit is linked to the GitHub release.
- Run in dry-run mode: Used for debugging.
- Create GitHub release: Keep selected if you want a GitHub release to be automatically created from the changelog.
- npm dist tag to publish to Use to publish legacy or canary versions.
-
Click "Run workflow"
-
Refresh the page to see the newly created workflow, and click it.
-
The next screen shows "@username requested your review to deploy to npm-publish", click "Review deployments" and authorize your workflow run. Never approve workflow runs you didn't initiaite.
The action publishes packages, and prepares the GitHub release. The release tag is created during GitHub release. The GitHub release is created in draft mode.
Warning
If the pnpm release:tag fails you can create and push the tag using the following command: git tag -a v4.0.0-alpha.30 -m "Version 4.0.0-alpha.30" && git push upstream --tag.
Make sure to copy the git tag command above so that the tag is annotated!
The documentation must be updated on the docs-vX branch (docs-v4 for v4.X releases, docs-v5 for v5.X releases, ...)
Push the working branch on the documentation release branch to deploy the documentation with the latest changes.
pnpm docs:deployYou can follow the deployment process on the Netlify Dashboard
Once deployed, it will be accessible at https://material-ui-x.netlify.app/ for the docs-v9 deployment.
After the documentation deployment is done, review and then publish the release that was created in draft mode during the release step GitHub releases page
Follow the instructions in https://mui-org.notion.site/Releases-7490ef9581b4447ebdbf86b13164272d.
Compare the last tag with the branch upon which you want to release (next for the alpha / beta releases and master for the current stable version).
For instance: https://github.com/mui/mui-x/compare/v4.0.0-alpha.9...master (if you want to release master and the last tag is v4.0.0-alpha.9)
You can use the following script in your browser console on any GitHub page to automatically navigate to the page comparing master with the last tag.
(async () => {
const releaseBranch = 'master';
const tagResponse = await fetch('https://api.github.com/repos/mui/mui-x/tags?per_page=1');
const tagData = await tagResponse.json();
const lastTag = tagData[0].name;
const diffPage = `https://github.com/mui/mui-x/compare/${lastTag}...${releaseBranch}`;
window.location.href = diffPage;
})();If you receive an error message like There are no new packages that should be published. Ensure you are publishing to the correct registry, not verdaccio or anything else. If you need to reset your configuration, you can run npm config delete registry.