This is our official process for releasing new versions of the U.S. Web Design Standards.
- Principles
- Versioning
- What is a release?
- The public API
- Release process
- Git(/Hub) workflow
- Questions?
- 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
-
As a naming convention, your branch name can be anything except
master
,develop
, or with therelease-
orhotfix-
prefix -
Changes are merged back 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.:
```sh 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.
-
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.