To make a version of the React USWDS component library available to consumers, it must be published to npm.
A combination of tools work in concert to automate much of the release process.
Combined with our "squash and merge" preference on Pull Requests, each merged Pull Request results in a singular commit that can be parsed into our changelog.
Create and manage release PRs when releasable changes have been merged to main, based on our release-please configuration.
The primary purpose of release PRs is to update the changelog and increment the version number in package.json.
Merging a release-please release PR will automatically create a tag/release in GitHub.
The following custom actions support the release pipeline:
- release-please.yml enables release-please as described above.
- package-release.yml packages a clean, publishable build artifact for each release commit.
Publish and host versioned build artifacts for the community to download as a project dependency.
To perform a release, a maintainer must first
- Be part of the React USWDS Admins team.
- Be an Admin or Owner of the trussworks npm organization.
Additionally, at least one releasable change must have been merged to main since the previous release.
Note
If there are no releasable changes as defined by the release-please configuration, there will be no Release PR to start the release process with.
Follow these steps to create and publish a release for a given version, <major.minor.incremental>.
-
Review and merge the current release PR.
- Ensure the branch is up to date with
main. - PR CI checks will likely be stuck in a pending state on the release PR requiring administrator override to merge. This is because GitHub actions in a workflow run cannot trigger new workflow runs. Since
release-pleasecreates and updates the release PR via a workflow action, PR checks will not run under normal circumstances. We consider this acceptable since release PRs do not change code.
- Ensure the branch is up to date with
-
Wait for
release-pleaseto create the corresponding tag in GitHub including the updates from the changelog. -
Find and wait for the corresponding package-release.yml action to complete.
-
From the successful package-release workflow run, download the build artifact from the
Artifactssection of the build summary:
-
Get the tarball (
trussworks-react-uswds-<major.minor.incremental>.tgz) by unzipping the downloadedartifact.zipunzip artifact.zip
- If, instead of the terminal, you wish to use Archive Utility to unzip
arifact.zipbe aware that Archive Utility defaults to recursively unzipping files, including the.tgzitself when unzipping theartifact.zip. You will first need to disable the "Keep expanding if possible" setting in your Archive Utility preferences.
- If, instead of the terminal, you wish to use Archive Utility to unzip
-
Publish the tarball (
trussworks-react-uswds-<major.minor.incremental>.tgz) to npm by running the following command and following the prompts in your terminal.npm publish trussworks-react-uswds-<major.minor.incremental>.tgz
-
Notify our
#g-uswdsand#g-uswds-publicSlack channels about the release.
Warning
If any automations are not working for any reason but a release needs to go out before triaging and fixing them, you will have to emulate the corresponding steps manually.
The automations are composed to avoid common "gotchas" so take care at each step to emulate exactly the outputs of previous automation runs.
If a release is fundamentally broken for all consumers, the followings steps are recommended to resolve:
- Triage and fix the issue via the normal bug fix Pull Request process.
- Publish a new release following the normal release steps.
- Deprecate the broken version in npm so that consumers know to upgrade