diff --git a/README.md b/README.md index e88cbdfe74..8068bb186c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/guides/RELEASE-PROCESS.md b/guides/RELEASE-PROCESS.md index 272a5478e7..b815b24620 100644 --- a/guides/RELEASE-PROCESS.md +++ b/guides/RELEASE-PROCESS.md @@ -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** @@ -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: diff --git a/package.json b/package.json index aaa0801b13..9878b7488d 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/prepublish.sh b/prerelease.sh similarity index 94% rename from prepublish.sh rename to prerelease.sh index 86e3e1a940..284a533788 100755 --- a/prepublish.sh +++ b/prerelease.sh @@ -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}"