Mayflower Release involves cutting a Github tag following Semantic Versioning leveraging CircleCI with these scripts. The release entails:
- Build and publish the @massds/mayflower-assets NPM packages
- Build and publish the @massds/mayflower-react NPM package
- Build and publish the massgov/mayflower-artifacts PHP package
- Build and publish the @massds/mayflower NPM package (deprecated)
- Build, test and deploy the Mayflower homepage site
- Build, test and deploy the Patternlab site
- Build, test and deploy the React Storybook site
- Build, test and deploy the Core documentation site
Mayflower releases are automated using CircleCI and it's scheduled for every Monday at 2pm (EDT) (See the cron time in CircleCI config).
- At the scheduled cron time, CircleCI will run release_branch and try to create a release branch from develop. (If no new changelogs, the task will fail and stop.)
- A release branch will be created based on the previous release tag, e.g. 9.38.0, and increment based on the impact levels in each new changelogs. E.g. only "patches"
- The script compile-changelogs gets triggered on the release branch, and all files under the changelog folder gets compiled and added to CHANGELOG.md.
- A pull request gets created into master with descriptions
- Once all the Circle tests are passed in the PR, review and "Merge" the PR into master.
- Upon approving the release PR, release the "hold" on
github_tag
in CircleCI. - A release will be cut for Mayflower.
- Merge
master
back intodevelop
.
To do a hotfix directly into master
:
- Create a hotfix branch with the prefix
hotfix/
. - After committing your changes, create a Pull Request into the
master
branch. - Add a changelog following the changelog template.
- Run script
node scripts/compile-changelogs
from the repo root. - Commit the changes and push up to the remote hotfix branch.
- Once all the Circle tests are passed in the PR, review and "Squash and merge" the PR into master.
- Upon approving the release PR, release the "hold" on
github_tag
in CircleCI. - A release will be cut for Mayflower.
- Merge
master
back intodevelop
.
In a case that a manual release from develop
is needed:
- Run
$ node scripts/release-branch.js
from the repo root ondevelop
branch - A release branch will be created with changelogs compiled and changes committed.
- Push up the branch and create a PR into
master
, add the newly compiled changelogs to the description as the PR description. - Once all the Circle tests are passed in the PR, review and "Merge" the PR into master.
- Upon approving the release PR, release the "hold" on
github_tag
in CircleCI. - A release will be cut for Mayflower.
- Merge
master
back intodevelop
.
If you have a Github API token that has write access to the Mayflower Repo, instead of the steps above you can also automate the pull request creation by running (Linux):
DANGER_GITHUB_API_TOKEN=[Your_Github_API_Token] node scripts/release-branch.js
The release automation requires the changelogs being compliant, refer to Changelog Instructions for more details.