Skip to content

Release Process

Ryan Johnson edited this page May 8, 2019 · 17 revisions

Releasing to NPM

Prerequisites

The npm whoami command should respond with "helix-ui".

$ npm whoami
helix-ui

If a different value or no value comes back, STOP!

Ask a HelixUI dev for help, before you continue.

1. Preparation

1.1 Stop Local Dev Servers

Stop all yarn start or yarn serve commands.

1.2 Update working copy to latest changes in master

To release the latest code, you'll need the latest code 😄.

git checkout master
git pull

1.3 Clean up generated assets

To ensure a clean release, you'll want to make sure that generated assets are created as cleanly as possible.

  • The npm publish command will package up everything in dist/ and publish to NPM.
  • The npm run ghpages command will push files in public/.
# Clean up generated files
rm -rf dist public

The prepublish script will handle recompiling assets before things get sent to NPM.

1.4 Install fresh dependencies

Development dependencies should be reinstalled to minimize the chances for unexpected errors.

yarn install:clean

2. Create Release Branch

Given that the release tasks will update package.json, we want to make sure we stick to a feature branch workflow so that we can merge the version changes back into master.

The name of this branch doesn't matter, but it does need to be based off master.

A good naming convention to follow is release-{VERSION} (e.g., release-v0.16.1)

git checkout -t -b release-{VERSION}

3. Bump Version

npm already has logic built-in to bump the version number. Run npm help version for more information.

WARNING: npm currently does not have a dry run option. Start with premajor, preminor, or prepatch to make sure everything is running smoothly before you publish.

npm version (major | minor | patch | premajor | preminor | prepatch | prerelease)

Version Example

Say we're currently at 0.0.1 of HelixUI.

npm version prepatch   # 0.0.2-rc.0
npm version prerelease # 0.0.2-rc.1
npm version patch      # 0.0.2

npm version preminor   # 0.1.0-rc.0
npm version prerelease # 0.1.0-rc.1
npm version minor      # 0.1.0

npm version premajor   # 1.0.0-rc.0
npm version prerelease # 1.0.0-rc.1
npm version major      # 1.0.0

4. Publish Assets

NOTE: This step requires npm whoami to be set up correctly.

To publish new assets to NPM, just run:

npm publish

Verify via Browser

Check the version displayed for the helix-ui package on npmjs.com.

Verify via CLI

Check the output of:

npm view helix-ui version versions

5. Update Master

Because npm version uses and modifies package.json, you'll need to merge changes back into master so that future releases will start with the correct version.

  1. Push your branch to github
  2. Submit a PR against the master branch
  3. Merge the PR
  • It's a one-line change to a non-functional file, so there's no chance it'll break functionality of distributed assets.
  1. Delete version branch
  2. ???
  3. Profit!!!

Publishing Documentation

Documentation is published separately from npm assets. This process can be run independently of the release to push updated documentation without the need to release new NPM assets.

There are two types of documentation:

  1. Production Docs
  2. Pre-release Docs

Production Docs

Documentation for functionality that is available on NPM.

URL: https://rackerlabs.github.io/helix-ui/

Steps

From the root of the project, run the following command:

npm run ghpages

Pre-Release Documentation

Documentation for functionality that is not yet available on NPM.

URL: https://helix-ui.netlify.com

Steps

  1. Log in to https://app.netlify.com/
  2. Open the "helix-ui" site
  3. Navigate to "Deploys"
  4. From the "Trigger Deploy" dropdown menu, click "Deploy Site".
  5. Wait for Netlify to report status
Clone this wiki locally