Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Component release management

Courtney Brousseau edited this page Jun 14, 2019 · 14 revisions

@code.gov/* component release process

This is our official process for releasing new versions of @code.gov/* components:

code-gov-front-end consumes all of these @code.gov/* packages through npm. Therefore, any component package that is updated between releases of code-gov-front-end must also be released, published to npm, and updated in the package.json of code-gov-front-end before deploying and publishing a new version of code-gov-front-end.

Table of Contents

  1. Versioning
  2. Release process
    1. Git workflow
    2. Publishing a new release

Versioning

See Version Control for more information about semantic versioning and what constitutes a release

Release process

Git workflow

See Git Workflow for more information about how to create new branches and suggest changes to @code.gov/* repositories

Publishing a new release

⚠️ In these docs, {{ version }} should always be replaced with the semantic version number, i.e. 1.2.1 ⚠️

Before you get started, close all running processes in the terminal.

Create the release branch

  • Determine if the version is a patch (#.#.#), minor (#.#.0), or major (#.0.0) version

  • Branch off master and use the branch name format release-{{ version }}:

           git pull origin master
           git checkout -b release-{{ version }} origin/master
    

Example > git checkout -b release-0.0.7 origin/master


Version the release with npm

npm version will increment the version number semantically in package.json and commit the changes to git. Versions will be tagged on the master branch. See the npm publish documentation for additional options.

  • For prerelease releases: Run npm version prerelease --no-tag.
  • For patch releases: Run npm version patch --no-tag.
  • For minor releases: Run npm version minor --no-tag.
  • For major releases: Run npm version major --no-tag.

This bumps the version number in package.json and commits that change. It should echo back the new version number to your terminal command line. git log should show that new commit.


Publish the release to npm

  • Push the version branch up to GitHub
  • Merge release-{{ version }} back in to the master branch
  • Run git checkout master and git pull origin master to update your local repository
  • Run npm publish to release the package to the npm directory
  • Check that the new release was published to npm

If you get the following error then run npm login to authenticate to npm.

 npm ERR! publish Failed PUT 401  
 npm ERR! code E401  
 npm ERR! You must be logged in to publish packages.

Create the release in GitHub

  • On the releases page for the repository on GitHub.com, select the release draft notes you had previously started or Draft a new release
  • Add the tag: v{{ version }}
  • Use target: master
  • For any release of code-gov-style or major releases of another component, add release notes to the body and have at least one team member review the release notes
  • Select Publish release

Update the version number in the package.json of code-gov-front-end

  • Create a new branch of code-gov-front-end following our Git Workflow
  • Open the package.json of code-gov-front-end
  • Update the version number of the package(s) you just published to npm and GitHub
  • Commit the changes and make a PR to master to update code-gov-front-end before the next deployment of the front end

Clone this wiki locally