Skip to content

Commit bd352f0

Browse files
committed
doc: update and improve the release guide
PR-URL: #21868 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent fd5a0c7 commit bd352f0

File tree

1 file changed

+111
-62
lines changed

1 file changed

+111
-62
lines changed

doc/releases.md

+111-62
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ Notes:
7878

7979
- Dates listed below as _"YYYY-MM-DD"_ should be the date of the release **as
8080
UTC**. Use `date -u +'%Y-%m-%d'` to find out what this is.
81-
- Version strings are listed below as _"vx.y.z"_. Substitute for the release
82-
version.
81+
- Version strings are listed below as _"vx.y.z"_ or _"x.y.z"_. Substitute for
82+
the release version.
83+
- Examples will use the fictional release version `1.2.3`.
8384

8485
### 0. Pre-release steps
8586

@@ -98,29 +99,54 @@ of the `nodejs-private/node-private` repository a day or so before the
9899
[CI lockdown procedure][] begins. This is to confirm that Jenkins can properly
99100
access the private repository.
100101

101-
### 1. Cherry-picking from `master` and other branches
102+
### 1. Update the staging branch
102103

103-
Create a new branch named _"vx.y.z-proposal"_, or something similar. Using `git
104-
cherry-pick`, bring the appropriate commits into your new branch. To determine
105-
the relevant commits, use [`branch-diff`](https://github.com/rvagg/branch-diff)
106-
and [`changelog-maker`](https://github.com/rvagg/changelog-maker/) (both are
107-
available on npm and should be installed globally). These tools depend on our
108-
commit metadata, as well as the `semver-minor` and `semver-major` GitHub labels.
109-
One drawback is that when the `PR-URL` metadata is accidentally omitted from a
110-
commit, the commit will show up because it's unsure if it's a duplicate or not.
104+
Checkout the staging branch locally.
111105

112-
For a list of commits that could be landed in a patch release on v5.x:
106+
```console
107+
$ git remote update
108+
$ git checkout v1.x-staging
109+
$ git reset --hard upstream/v1.x-staging
110+
```
111+
112+
If the staging branch is not up to date relative to `master`, bring the
113+
appropriate commits into it. To determine the relevant commits, use
114+
[`branch-diff`](https://github.com/nodejs/branch-diff). The tool is available on
115+
npm and should be installed globally or run with `npx`. It depends on our commit
116+
metadata, as well as the GitHub labels such as `semver-minor` and
117+
`semver-major`. One drawback is that when the `PR-URL` metadata is accidentally
118+
omitted from a commit, the commit will show up because it's unsure if it's a
119+
duplicate or not.
120+
121+
For a list of commits that could be landed in a patch release on v1.x:
113122

114123
```console
115-
$ branch-diff v5.x master --exclude-label=semver-major,semver-minor,dont-land-on-v5.x --filter-release --format=simple
124+
$ branch-diff v1.x-staging master --exclude-label=semver-major,semver-minor,dont-land-on-v1.x,backport-requested-v1.x --filter-release --format=simple
116125
```
117126

118127
Carefully review the list of commits looking for errors (incorrect `PR-URL`,
119-
incorrect semver, etc.). Commits labeled as semver minor or semver major should
120-
only be cherry-picked when appropriate for the type of release being made.
121-
Previous release commits and version bumps do not need to be cherry-picked.
128+
incorrect semver, etc.). Commits labeled as `semver-minor` or `semver-major`
129+
should only be cherry-picked when appropriate for the type of release being
130+
made. Previous release commits and version bumps do not need to be
131+
cherry-picked.
132+
133+
If commits were cherry-picked in this step, push to the staging branch to keep
134+
it up-to-date.
135+
136+
```console
137+
$ git push upstream v1.x-staging
138+
```
139+
140+
### 2. Create a new branch for the release
141+
142+
Create a new branch named `vx.y.z-proposal`, off the corresponding staging
143+
branch.
144+
145+
```console
146+
$ git checkout -b v1.2.3-proposal upstream/v1.x-staging
147+
```
122148

123-
### 2. Update `src/node_version.h`
149+
### 3. Update `src/node_version.h`
124150

125151
Set the version for the proposed release using the following macros, which are
126152
already defined in `src/node_version.h`:
@@ -160,12 +186,12 @@ informed perspective, such as a member of the NAN team.
160186
see a need to bump `NODE_MODULE_VERSION` then you should consult the TSC.
161187
Commits may need to be reverted or a major version bump may need to happen.
162188

163-
### 3. Update the Changelog
189+
### 4. Update the Changelog
164190

165-
#### Step 1: Collecting the formatted list of changes:
191+
#### Step 1: Collect the formatted list of changes
166192

167193
Collect a formatted list of commits since the last release. Use
168-
[`changelog-maker`](https://github.com/rvagg/changelog-maker) to do this:
194+
[`changelog-maker`](https://github.com/nodejs/changelog-maker) to do this:
169195

170196
```console
171197
$ changelog-maker --group
@@ -176,12 +202,12 @@ in the repository was not on the current branch you may have to supply a
176202
`--start-ref` argument:
177203

178204
```console
179-
$ changelog-maker --group --start-ref v2.3.1
205+
$ changelog-maker --group --start-ref v1.2.2
180206
```
181207

182208
#### Step 2: Update the appropriate doc/changelogs/CHANGELOG_*.md file
183209

184-
There is a separate `CHANGELOG_*.md` file for each major Node.js release line.
210+
There is a separate `CHANGELOG_Vx.md` file for each major Node.js release line.
185211
These are located in the `doc/changelogs/` directory. Once the formatted list of
186212
changes is collected, it must be added to the top of the relevant changelog file
187213
in the release branch (e.g. a release for Node.js v4 would be added to the
@@ -210,18 +236,22 @@ The new entry should take the following form:
210236
The release type should be either Current, LTS, or Maintenance, depending on the
211237
type of release being produced.
212238

239+
You can use `branch-diff` to get a list of commits with the `notable-change`
240+
label:
241+
242+
```console
243+
$ branch-diff upstream/v1.x v1.2.3-proposal --require-label=notable-change -format=simple
244+
```
245+
213246
Be sure that the `<a>` tag, as well as the two headings, are not indented at
214247
all.
215248

216-
At the top of each `CHANGELOG_*.md` file, and in the root `CHANGELOG.md` file,
217-
there is a table indexing all releases in each major release line. A link to the
218-
new release needs to be added to each. Follow the existing examples and be sure
219-
to add the release to the *top* of the list.
220-
221-
In the root `CHANGELOG.md` file, the most recent release for each release line
222-
is shown in **bold** in the index. When updating the index, please make sure to
223-
update the display accordingly by removing the bold styling from the previous
224-
release.
249+
At the top of the root `CHANGELOG.md` file, there is a table indexing all
250+
releases in each major release line. A link to the new release needs to be added
251+
to it. Follow the existing examples and be sure to add the release to the *top*
252+
of the list. The most recent release for each release line is shown in **bold**
253+
in the index. When updating the index, please make sure to update the display
254+
accordingly by removing the bold styling from the previous release.
225255

226256
#### Step 3: Update any REPLACEME and DEP00XX tags in the docs
227257

@@ -239,12 +269,12 @@ If this release includes any new deprecations it is necessary to ensure that
239269
those are assigned a proper static deprecation code. These are listed in the
240270
docs (see `doc/api/deprecations.md`) and in the source as `DEP00XX`. The code
241271
must be assigned a number (e.g. `DEP0012`). Note that this assignment should
242-
occur when the PR is landed, but a check will be made when the release built is
272+
occur when the PR is landed, but a check will be made when the release build is
243273
run.
244274

245-
### 4. Create Release Commit
275+
### 5. Create Release Commit
246276

247-
The `CHANGELOG.md`, `doc/changelogs/CHANGELOG_*.md`, `src/node_version.h`, and
277+
The `CHANGELOG.md`, `doc/changelogs/CHANGELOG_Vx.md`, `src/node_version.h`, and
248278
`REPLACEME` changes should be the final commit that will be tagged for the
249279
release. When committing these to git, use the following message format:
250280

@@ -256,38 +286,40 @@ Notable changes:
256286
* Copy the notable changes list here, reformatted for plain-text
257287
```
258288

259-
### 5. Propose Release on GitHub
289+
### 6. Propose Release on GitHub
260290

261291
Push the release branch to `nodejs/node`, not to your own fork. This allows
262292
release branches to more easily be passed between members of the release team if
263293
necessary.
264294

265295
Create a pull request targeting the correct release line. For example, a
266-
v5.3.0-proposal PR should target v5.x, not master. Paste the CHANGELOG
296+
`v5.3.0-proposal` PR should target `v5.x`, not master. Paste the CHANGELOG
267297
modifications into the body of the PR so that collaborators can see what is
268298
changing. These PRs should be left open for at least 24 hours, and can be
269299
updated as new commits land.
270300

271301
If you need any additional information about any of the commits, this PR is a
272302
good place to @-mention the relevant contributors.
273303

274-
This is also a good time to update the release commit to include `PR-URL`
275-
metadata.
304+
After opening the PR, update the release commit to include `PR-URL` metadata and
305+
force-push the proposal.
276306

277-
### 6. Ensure that the Release Branch is Stable
307+
### 7. Ensure that the Release Branch is Stable
278308

279-
Run a
280-
**[node-test-pull-request](https://ci.nodejs.org/job/node-test-pull-request/)**
309+
Run a **[`node-test-pull-request`](https://ci.nodejs.org/job/node-test-pull-request/)**
281310
test run to ensure that the build is stable and the HEAD commit is ready for
282311
release.
283312

284-
Perform some smoke-testing. We have [citgm](https://github.com/nodejs/citgm) for
285-
this. You can also manually test important modules from the ecosystem. Remember
286-
that node-gyp and npm both take a `--nodedir` flag to point to your local
287-
repository so that you can test unreleased versions without needing node-gyp to
288-
download headers for you.
313+
Also run a **[`node-test-commit-v8-linux`](https://ci.nodejs.org/job/node-test-commit-v8-linux/)**
314+
test run if the release contains changes to `deps/v8`.
289315

290-
### 7. Produce a Nightly Build _(optional)_
316+
Perform some smoke-testing. There is the
317+
**[`citgm-smoker`](https://ci.nodejs.org/job/citgm-smoker/)** CI job for this
318+
purpose. Run it once with the base `vx.x` branch as a reference and with the
319+
proposal branch to check if new regressions could be introduced in the
320+
ecosystem.
321+
322+
### 8. Produce a Nightly Build _(optional)_
291323

292324
If there is a reason to produce a test release for the purpose of having others
293325
try out installers or specifics of builds, produce a nightly build using
@@ -299,7 +331,7 @@ enter a proper length commit SHA, enter a date string, and select "nightly" for
299331
This is particularly recommended if there has been recent work relating to the
300332
macOS or Windows installers as they are not tested in any way by CI.
301333

302-
### 8. Produce Release Builds
334+
### 9. Produce Release Builds
303335

304336
Use **[iojs+release](https://ci-release.nodejs.org/job/iojs+release/)** to
305337
produce release artifacts. Enter the commit that you want to build from and
@@ -345,19 +377,19 @@ can use the
345377
build in the release CI to re-run the build only for ARMv6. When launching the
346378
build make sure to use the same commit hash as for the original release.
347379

348-
### 9. Test the Build
380+
### 10. Test the Build
349381

350382
Jenkins collects the artifacts from the builds, allowing you to download and
351383
install the new build. Make sure that the build appears correct. Check the
352384
version numbers, and perform some basic checks to confirm that all is well with
353385
the build before moving forward.
354386

355-
### 10. Tag and Sign the Release Commit
387+
### 11. Tag and Sign the Release Commit
356388

357389
Once you have produced builds that you're happy with, create a new tag. By
358390
waiting until this stage to create tags, you can discard a proposed release if
359391
something goes wrong or additional commits are required. Once you have created a
360-
tag and pushed it to GitHub, you ***should not*** delete and re-tag. If you make
392+
tag and pushed it to GitHub, you ***must not*** delete and re-tag. If you make
361393
a mistake after tagging then you'll have to version-bump and start again and
362394
count that tag/version as lost.
363395

@@ -388,7 +420,7 @@ following command:
388420
$ git push <remote> <vx.y.z>
389421
```
390422

391-
### 11. Set Up For the Next Release
423+
### 12. Set Up For the Next Release
392424

393425
On release proposal branch, edit `src/node_version.h` again and:
394426

@@ -407,17 +439,26 @@ This sets up the branch so that nightly builds are produced with the next
407439
version number _and_ a pre-release tag.
408440

409441
Merge your release proposal branch into the stable branch that you are releasing
410-
from (e.g. `v8.x`), and rebase the corresponding staging branch (`v8.x-staging`)
411-
on top of that.
442+
from and rebase the corresponding staging branch on top of that.
443+
444+
```console
445+
$ git checkout v1.x
446+
$ git merge --ff-only v1.2.3-proposal
447+
$ git push upstream v1.x
448+
$ git checkout v1.x-staging
449+
$ git rebase v1.x
450+
$ git push upstream v1.x-staging
451+
```
412452

413453
Cherry-pick the release commit to `master`. After cherry-picking, edit
414454
`src/node_version.h` to ensure the version macros contain whatever values were
415-
previously on `master`. `NODE_VERSION_IS_RELEASE` should be `0`.
455+
previously on `master`. `NODE_VERSION_IS_RELEASE` should be `0`. **Do not**
456+
cherry-pick the "Working on vx.y.z" commit to `master`.
416457

417458
Run `make lint-md-build; make lint` before pushing to `master`, to make sure the
418459
Changelog formatting passes the lint rules on `master`.
419460

420-
### 12. Promote and Sign the Release Builds
461+
### 13. Promote and Sign the Release Builds
421462

422463
**It is important that the same individual who signed the release tag be the one
423464
to promote the builds as the SHASUMS256.txt file needs to be signed with the
@@ -469,7 +510,7 @@ be prompted to re-sign SHASUMS256.txt.
469510
*Note*: It is possible to only sign a release by running `./tools/release.sh -s
470511
vX.Y.Z`.
471512

472-
### 13. Check the Release
513+
### 14. Check the Release
473514

474515
Your release should be available at `https://nodejs.org/dist/vx.y.z/` and
475516
<https://nodejs.org/dist/latest/>. Check that the appropriate files are in
@@ -478,7 +519,7 @@ have the right internal version strings. Check that the API docs are available
478519
at <https://nodejs.org/api/>. Check that the release catalog files are correct
479520
at <https://nodejs.org/dist/index.tab> and <https://nodejs.org/dist/index.json>.
480521

481-
### 14. Create a Blog Post
522+
### 15. Create a Blog Post
482523

483524
There is an automatic build that is kicked off when you promote new builds, so
484525
within a few minutes nodejs.org will be listing your new version as the latest
@@ -512,7 +553,7 @@ This script will use the promoted builds and changelog to generate the post. Run
512553
- Changes to `master` on the nodejs.org repo will trigger a new build of
513554
nodejs.org so your changes should appear in a few minutes after pushing.
514555

515-
### 15. Announce
556+
### 16. Announce
516557

517558
The nodejs.org website will automatically rebuild and include the new version.
518559
To announce the build on Twitter through the official @nodejs account, email
@@ -527,11 +568,19 @@ To ensure communication goes out with the timing of the blog post, please allow
527568
will be shared with the community in the email to coordinate these
528569
announcements.
529570

530-
### 16. Cleanup
571+
### 17. Create the release on GitHub
572+
573+
- Got to the [New release page](https://github.com/nodejs/node/releases/new).
574+
- Select the tag version you pushed earlier.
575+
- For release title, copy the title from the changelog.
576+
- For the description, copy the rest of the changelog entry.
577+
- Click on the "Publish release" button.
578+
579+
### 18. Cleanup
531580

532-
Close your release proposal PR and remove the proposal branch.
581+
Close your release proposal PR and delete the proposal branch.
533582

534-
### 17. Celebrate
583+
### 19. Celebrate
535584

536585
_In whatever form you do this..._
537586

0 commit comments

Comments
 (0)