Skip to content

Commit

Permalink
[WNMGDS-637] Update release process guide (#823)
Browse files Browse the repository at this point in the history
* Update release process guide

* Format the steps

* Merge PR instead of branch

* Separate the relase script into 2 steps - 'yarn pre-release' and 'yarn release'

* Include the folders and files to check for in the zip

* Update guides/RELEASE-PROCESS.md

Co-authored-by: Bernard <[email protected]>

* Update guides/RELEASE-PROCESS.md

Co-authored-by: Bernard <[email protected]>

* Update release process

* Update information for release scripts

* Remove the extra file info

* Rename prepublish.sh to prerelease.sh

* Rename pre-release to prerelease

* Update guides/RELEASE-PROCESS.md

Co-authored-by: Bernard <[email protected]>

Co-authored-by: Scott Weber <[email protected]>
Co-authored-by: Bernard <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2020
1 parent 6db8583 commit 1f362d7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ These scripts can all be run from the root level of the repo:
- Regenerates documentation when files change
- `yarn build`
- Compile/transpile/uglify everything and makes things release-ready.
- `yarn prerelease`
- Increments package versions. Read our [Release Process guide](/guides/RELEASE-PROCESS.md) for more info.
- `yarn release`
- Increments package versions and publishes npm packages. Read our [Release Process guide](/guides/RELEASE-PROCESS.md) for more info.
- Publishes npm packages. Read our [Release Process guide](/guides/RELEASE-PROCESS.md) for more info.
- `yarn test`
- Runs JS unit tests
- Runs Prettier for formatting
Expand Down
42 changes: 28 additions & 14 deletions guides/RELEASE-PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@
**Note**: Your NPM account must access to the CMS group and provide a valid access token. To add a token, edit your `~/.npmrc` file so the contents are `//registry.npmjs.org/:_authToken={token}`
1. Run the release script to automatically begin the release process and publish to NPM.
1. Run the prerelease script to prepare the repo for publishing.
```
yarn release
yarn prerelease
```
This script will install dependencies, build design system assets, and run the linter and tests. If everything passes, `lerna` will prompt you for the new version number, which should follow the [SemVer release format](#versioning). After the versions are updated, the script will create a tagged release commit (prefaced with `core-`), a branch (prefaced with `release-`) containing the release commit, and a zip for the Github release notes.
1. The last step in the script will prompt you to continue with publishing to NPM. Proceed if everything is ready.
1. After the release script is completed, make sure to merge the release branch (i.e. `release-2.0.0`) into master.
1. After the prerelease script is completed, unpack the release zips created from the release script (i.e. `cmsgov-design-system-2.0.0.tgz`) and check the relevant folders and files are present. Confirm that the cmsgov-design-system release zip contains the `dist` folder.
1. The next step is to run the lerna publish command for publish to [NPM](https://www.npmjs.com/package/@cmsgov/design-system).
```
yarn release
```
1. Create a PR for the release branch titled after the release (i.e. `Release 2.0.0`). Merge the PR into master after the changes are approved.
1. **Create a release on GitHub**
Expand All @@ -28,26 +38,30 @@
1. Attach the release zip created from the previous step (i.e. `cmsgov-design-system-2.0.0.tgz`) to the release as an asset
1. Create sections for [@cmsgov/design-system](https://www.npmjs.com/package/@cmsgov/design-system), [@cmsgov/design-system-scripts](https://www.npmjs.com/package/@cmsgov/design-system-scripts) and [@cmsgov/design-system-docs](https://www.npmjs.com/package/@cmsgov/design-system-docs) using the subsections below.
```
## 🚨 Breaking/Behavioral changes
## 🚀 Added
## 💅 Changed
## 🛠 Fixed
## 📦 Internal
## 🚫 Deprecated
```
```
## 🚨 Breaking/Behavioral changes
## 🚀 Added
## 💅 Changed
## 🛠 Fixed
## 📦 Internal
## 🚫 Deprecated
```
**Note**: View commits since the last release by going to the [releases page](https://github.com/CMSgov/design-system/releases) or by running: `` git log `git describe --tags --abbrev=0`..HEAD --oneline ``
**Note**: View commits since the last release by going to the [releases page](https://github.com/CMSgov/design-system/releases) or by running: `` git log `git describe --tags --abbrev=0`..HEAD --oneline ``
1. Review the release notes and publish
1. **Update the design.cms.gov documentation website**
1. Connect to CMS VPN `cloudvpn.cms.gov`.
1. [Log in to CBJ](https://cloudbeesjenkins.cms.gov/prod-master/job/wds/job/Design%20System/job/Deploy%20design-system/) to Deploy the CMS Design System documentation website.
**Note**: Your CBJ user will need to be a member of the `wd-user` group or you will be unable to see the linked job above.
1. Select the tag created in the first step (i.e. `core-2.0.0`) as the branch to deploy.
1. Select `Build with Parameters` on the side navigation menu.
1. Enter the `tag` created in the first step (i.e. `core-2.0.0`) as the branch to deploy.
Deploying the documentation website is a multi-stage pipeline that executes the deploy in two stages:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"scripts": {
"start": "yarn cmsds start",
"build": "yarn cmsds build-docs",
"release": "./prepublish.sh && yarn lerna publish from-git",
"prerelease": "./prerelease.sh",
"release": "yarn lerna publish from-git",
"precommit": "lint-staged",
"test": "yarn test:unit",
"test:unit": "yarn cmsds test ./packages",
Expand Down
2 changes: 1 addition & 1 deletion prepublish.sh → prerelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ npm pack ./packages/design-system/
npm pack ./packages/design-system-docs/
npm pack ./packages/design-system-scripts/

echo "${GREEN}Prepublish complete, make sure to merge the release branch $TAG_PREFIX$PACKAGE_VERSION into master...${NC}"
echo "${GREEN}Prerelease complete, make sure to merge the release branch $TAG_PREFIX$PACKAGE_VERSION into master...${NC}"

0 comments on commit 1f362d7

Please sign in to comment.