This is our official process for releasing new versions of the U.S. Web Design Standards.
- Follow well-established versioning practices
- Provide detailed notes for each release
- Encourage contributions and thank contributors for their hard work
Semantic versioning is a method of numbering release versions that
aims to help users understand the implications of upgrading from one
release to another. Semantic version numbers take the
form major.minor.patch
, where:
- Bug fixes increment the
patch
number (e.g.1.0.0
to1.0.1
) - New features increment the
minor
number and resetpatch
(e.g.1.0.1
to1.1.0
) - Changes to the public API (breaking changes) increment the
major
version and resetminor
andpatch
(e.g.1.1.2
to2.0.0
)
Technically, release of the Web Design Standards core code "lives" in two different places:
- On GitHub as a tag and corresponding release
- On npm as a release of the
uswds
package with the same version number as the GitHub release
In most software projects, the "public API" corresponds to a single set of programming constructs, such as public classes or functions. Because the Standards consist of tightly-bound HTML, CSS, and JavaScript, we must consider any "breaking" change to any of these as a change to the public API. For example, any of the following should trigger a major version increment:
- Changing the name of any
.usa-
class name (documented or not) - Changing the way in which elements with
.usa-
class names are structured in HTML - Changing the HTML "API" for any of our interactive components, such as the accordion
-
We have two main branches that are never deleted:
master
always points to the latest releasedevelop
contains changes being prepped for a release
-
When introducing a change (feature, bug fix, etc.):
-
Branch off
develop
:git fetch origin git checkout -b feature-foo origin/develop
-
Name your branch pretty much anything except
master
,develop
, or with therelease-
orhotfix-
prefix. Suggested prefixes includerefactor-
,feature-
,docs-
, andpatch-
. -
File your pull request to merge into the
develop
branch.
-
-
When publishing a new release:
-
Branch off
develop
and use the branch name formatrelease-{version}
, e.g.git fetch origin git checkout -b release-1.0.0 origin/develop
-
Run
npm version
with--no-tag
to increment the version number semantically. (Versions are tagged on themaster
branch.)-
For minor and major versions, publish a pre-release:
npm version prerelease --no-tag
-
Otherwise, run either
npm version minor --no-tag
ornpm version major --no-tag
-
In either case,
npm version
will increment the version number inpackage.json
and commit the changes to git.
-
-
Open a pull request from your
release-
branch to merge intomaster
. List the key changes for a release in the pull request description. (The diff will show you exactly what has changed since the previous release.) See the v1.0.0 pull request for an example. -
Tag the release on the
master
branch or create the tag when you draft the release notes. -
Merge the release commits back into
develop
frommaster
with a pull request. -
Write the release notes on GitHub:
-
Draft the release from the corresponding tag on the
master
branch. -
Have at least one team member review the release notes.
-
Publish the release on GitHub.
-
-
Update the docs site with the new version number and release notes:
-
Update the
uswds
Node dependency to the new version, e.g.:cd path/to/web-design-standards-docs export VERSION=1.0.0 git fetch origin git checkout -b release-${VERSION} origin/develop npm install --save-dev uswds@${VERSION}
-
Update the
version
variable in _config.yml. -
Follow the above release process to merge the changes to
master
via a pull request on the docs repo, minus the GitHub release notes.
-
-
When releasing potentially disruptive changes, it's good practice to publish pre-releases of planned versions. These are sometimes also called release candidates. Here's how it works:
-
Create a new branch from the release branch (
release-X.Y.Z
) with an additional pre-release identifier, such asrelease-1.1.0-pre
,release-1.1.0-alpha
,release-1.1.0-rc1
. -
Follow the release process for your pre-release branch, with the following modifications:
-
Publish to npm with a dist-tag, e.g.
npm version 1.1.0-pre npm publish --tag dev
-
Mark the GitHub release as a "pre-release", and be sure to note how long you intend on waiting for show-stopping bug reports before proceeding with the release.
-
Include instructions for installing the pre-release from npm with the dist-tag, e.g.:
npm install --save uswds@dev
-
Directly notify users who may be impacted by the proposed changes, and encourage them to alert us of any new issues within the prescribed testing period.
-
-
If you receive reports of any regressions (specifically, new issues introduced in the release), you can decide whether to address them in another pre-release or file them for the next official release. If you decide to move proceed with the release, it's good practice to alert users of the issue in your release notes, preferably with a
:warning:
emoji or similar. -
Otherwise, proceed with the next versioned release!
If you need help or have any questions, please reach out to us:
- File an issue on GitHub.
- Email us at [email protected].
- Sign up for our public Slack channel.