Read the docs for what to do before publishing a release to ensure you are prepared to publish.
See the documentation on support branches if you need to:
- publish a new release of previous major versions of GOV.UK Frontend
- publish a ‘hotfix’ release of GOV.UK Frontend without including other unreleased changes on the
main
branch
Developers should pair on releases. When remote working, it can be useful to be on a call together.
-
Check out the main branch and pull the latest changes.
-
Run
nvm use
to make sure you're using the right version of Node.js and npm. -
Run
npm ci
to make sure you have the exact dependencies installed. -
Create and check out a new branch (
release-[version-number]
). See the versioning documentation for more information. -
Update the
CHANGELOG.md
by:- changing the 'Unreleased' heading to the new version number and release type. For example, '3.11.0 (Feature release)'
- adding a new 'Unreleased' heading above the new version number and release type, so users will know where to add PRs to the changelog
- saving your changes
-
Apply the new version number by running:
npm version <NEW VERSION NUMBER> --no-git-tag-version --workspace govuk-frontend
This step will update the
package.json
and projectpackage-lock.json
files.Do not commit the changes.
-
Run
npm run build-release
to:- build GOV.UK Frontend into the
/package
and/dist
directories - commit the changes
- push a branch to GitHub
You will now be prompted to continue or cancel.
- build GOV.UK Frontend into the
-
Create a pull request and copy the changelog text. When reviewing the PR, check that the version numbers have been updated and that the compiled assets use this version number.
-
Once a reviewer approves the pull request, merge it to main.
-
Check out the main branch and pull the latest changes.
-
Sign in to npm (
npm login
), using the credentials for the govuk-patterns-and-tools npm user from Bitwarden. -
Run
npm run publish-release
, which will prompt you to check whether the npm tag looks as expected.If you're following these instructions, you're probably doing a sequential release, meaning the tag should be 'latest'.
-
Enter
y
to continue. If you think the tag should be different, enterN
to have the option to set your own npm tag. -
You will now be prompted to continue or cancel the release. Check the details and enter
y
to continue. If something does not look right, pressN
to cancel the release.This step will create a ZIP file containing the release in the root of your govuk-frontend git directory. You will need this file when creating the GitHub release.
It will also automatically create a tag in Github which you can use to create a Github release in the following section.
-
Run
npm logout
to log out from npm.
You can view the tag created during step 10 of creating the new version in the Github interface. To create a new Github release, do the following:
- Select the latest tag
- Press Create release from tag
- Set 'GOV.UK Frontend v[version-number]' as the title
- Add release notes from changelog
- Attach the ZIP file that has been generated at the root of this project during the npm publishing phase
- Publish release
Read the docs for what to do after publishing a release.