Release-Process.md
This file
Path
Release-Process.md
199 lines · 7.2 KiB · Markdown
Last changed by
Merge branch 'master' into 5.0ctcpipbefore adoptionc96c690
History of this fileTake it
Merge tag '4.15.0'Douglas Christopher Wilsonbefore adoption501e24e
lines 1–79why, one step back1# Express Release Process23This document contains the technical aspects of the Express release process. The4intended audience is those who have been authorized by the Express Technical5Committee (TC) to create, promote and sign official release builds for Express,6as npm packages hosted on https://npmjs.com/package/express.78## Who can make releases?910Release authorization is given by the Express TC. Once authorized, an individual11must have the following access permissions:1213### 1. Github release access1415The individual making the release will need to be a member of the16expressjs/express team with Write permission level so they are able to tag the17release commit and push changes to the expressjs/express repository18(see Steps 4 and 5).1920### 2. npmjs.com release access2122The individual making the release will need to be made an owner on the23`express` package on npmjs.com so they are able to publish the release24(see Step 6).2526## How to publish a release2728Before publishing, the following preconditions should be met:2930- A release proposal issue or tracking pull request (see "Proposal branch"31 below) will exist documenting:32 - the proposed changes33 - the type of release: patch, minor or major34 - the version number (according to semantic versioning - http://semver.org)35- The proposed changes should be complete.3637There are two main release flows: patch and non-patch.3839The patch flow is for making **patch releases**. As per semantic versioning,40patch releases are for simple changes, eg: typo fixes, patch dependency updates,41and simple/low-risk bug fixes. Every other type of change is made via the42non-patch flow.4344### Branch terminology4546"Master branch"4748- There is a branch in git used for the current major version of Express, named49 `master`.50- This branch contains the completed commits for the next patch release of the51 current major version.52- Releases for the current major version are published from this branch.5354"Version branch"5556- For any given major version of Express (current, previous or next) there is57 a branch in git for that release named `<major-version>.x` (eg: `4.x`).58- This branch points to the commit of the latest tag for the given major version.5960"Release branch"6162- For any given major version of Express, there is a branch used for publishing63 releases.64- For the current major version of Express, the release branch is the65 "Master branch" named `master`.66- For all other major versions of Express, the release branch is the67 "Version branch" named `<major-version>.x`.6869"Proposal branch"7071- A branch in git representing a proposed new release of Express. This can be a72 minor or major release, named `<major-version>.0` for a major release,73 `<major-version>.<minor-version>` for a minor release.74- A tracking pull request should exist to document the proposed release,75 targeted at the appropriate release branch. Prior to opening the tracking76 pull request the content of the release may have be discussed in an issue.77- This branch contains the commits accepted so far that implement the proposal78 in the tracking pull request.79Merge branch 'master' into 5.0ctcpipbefore adoptionc96c690
lines 80–86why, one step back80### Pre-release Versions8182Alpha and Beta releases are made from a proposal branch. The version number should be83incremented to the next minor version with a `-beta` or `-alpha` suffix.84For example, if the next beta release is `5.0.1`, the beta release would be `5.0.1-beta.0`.85The pre-releases are unstable and not suitable for production use.86Merge tag '4.15.0'Douglas Christopher Wilsonbefore adoption501e24e
lines 87–193why, one step back87### Patch flow8889In the patch flow, simple changes are committed to the release branch which90acts as an ever-present branch for the next patch release of the associated91major version of Express.9293The release branch is usually kept in a state where it is ready to release.94Releases are made when sufficient time or change has been made to warrant it.95This is usually proposed and decided using a github issue.9697### Non-patch flow9899In the non-patch flow, changes are committed to a temporary proposal branch100created specifically for that release proposal. The branch is based on the101most recent release of the major version of Express that the release targets.102103Releases are made when all the changes on a proposal branch are complete and104approved. This is done by merging the proposal branch into the release branch105(using a fast-forward merge), tagging it with the new version number and106publishing the release package to npmjs.com.107108### Flow109110Below is a detailed description of the steps to publish a release.111112#### Step 1. Check the release is ready to publish113114Check any relevant information to ensure the release is ready, eg: any115milestone, label, issue or tracking pull request for the release. The release116is ready when all proposed code, tests and documentation updates are complete117(either merged, closed or re-targeted to another release).118119#### Step 2. (Non-patch flow only) Merge the proposal branch into the release branch120121In the patch flow: skip this step.122123In the non-patch flow:124```sh125$ git checkout <release-branch>126$ git merge --ff-only <proposal-branch>127```128129<release-branch> - see "Release branch" of "Branches" above.130<proposal-branch> - see "Proposal branch" of "Non-patch flow" above.131132**NOTE:** You may need to rebase the proposal branch to allow a fast-forward133 merge. Using a fast-forward merge keeps the history clean as it does134 not introduce merge commits.135136### Step 3. Update the History.md and package.json to the new version number137138The changes so far for the release should already be documented under the139"unreleased" section at the top of the History.md file, as per the usual140development practice. Change "unreleased" to the new release version / date.141Example diff fragment:142143```diff144-unreleased145-==========146+4.13.3 / 2015-08-02147+===================148```149150The version property in the package.json should already contain the version of151the previous release. Change it to the new release version.152153Commit these changes together under a single commit with the message set to154the new release version (eg: `4.13.3`):155156```sh157$ git checkout <release-branch>158<..edit files..>159$ git add History.md package.json160$ git commit -m '<version-number>'161```162163### Step 4. Identify and tag the release commit with the new release version164165Create a lightweight tag (rather than an annotated tag) named after the new166release version (eg: `4.13.3`).167168```sh169$ git tag <version-number>170```171172### Step 5. Push the release branch changes and tag to github173174The branch and tag should be pushed directly to the main repository175(https://github.com/expressjs/express).176177```sh178$ git push origin <release-branch>179$ git push origin <version-number>180```181182### Step 6. Publish to npmjs.com183184Ensure your local working copy is completely clean (no extra or changed files).185You can use `git status` for this purpose.186187```sh188$ npm login <npm-username>189$ npm publish190```191192**NOTE:** The version number to publish will be picked up automatically from193 package.json.Merge tag '4.19.0' into 5.xWes Toddbefore adoptione9f9aae
lines 194–199why, one step back194 195### Step 7. Update documentation website196197The documentation website https://expressjs.com/ documents the current release version in various places. For a new release:1981. Change the value of `current_version` in https://github.com/expressjs/expressjs.com/blob/gh-pages/_data/express.yml to match the latest version number.1992. Add a new section to the change log. For example, for a 4.x release, https://github.com/expressjs/expressjs.com/blob/gh-pages/en/changelog/4x.md,