• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Node.js release process
2
3This document describes the technical aspects of the Node.js release process.
4The intended audience is those who have been authorized by the Node.js
5Technical Steering Committee (TSC) to create, promote, and sign
6official release builds for Node.js, hosted on <https://nodejs.org/>.
7
8## Table of contents
9
10* [Who can make a release?](#who-can-make-a-release)
11  * [1. Jenkins release access](#1-jenkins-release-access)
12  * [2. <nodejs.org> access](#2-nodejsorg-access)
13  * [3. A publicly listed GPG key](#3-a-publicly-listed-gpg-key)
14* [How to create a release](#how-to-create-a-release)
15  * [0. Pre-release steps](#0-pre-release-steps)
16  * [1. Update the staging branch](#1-update-the-staging-branch)
17  * [2. Create a new branch for the release](#2-create-a-new-branch-for-the-release)
18  * [3. Update `src/node_version.h`](#3-update-srcnode_versionh)
19  * [4. Update the changelog](#4-update-the-changelog)
20  * [5. Create release commit](#5-create-release-commit)
21  * [6. Propose release on GitHub](#6-propose-release-on-github)
22  * [7. Ensure that the release branch is stable](#7-ensure-that-the-release-branch-is-stable)
23  * [8. Produce a nightly build _(optional)_](#8-produce-a-nightly-build-optional)
24  * [9. Produce release builds](#9-produce-release-builds)
25  * [10. Test the build](#10-test-the-build)
26  * [11. Tag and sign the release commit](#11-tag-and-sign-the-release-commit)
27  * [12. Set up for the next release](#12-set-up-for-the-next-release)
28  * [13. Cherry-pick the release commit to `master`](#13-cherry-pick-the-release-commit-to-master)
29  * [14. Push the release tag](#14-push-the-release-tag)
30  * [15. Promote and sign the release builds](#15-promote-and-sign-the-release-builds)
31  * [16. Check the release](#16-check-the-release)
32  * [17. Create a blog post](#17-create-a-blog-post)
33  * [18. Create the release on GitHub](#18-create-the-release-on-github)
34  * [19. Cleanup](#19-cleanup)
35  * [20. Announce](#20-announce)
36  * [21. Celebrate](#21-celebrate)
37* [LTS releases](#lts-releases)
38* [Major releases](#major-releases)
39
40## Who can make a release?
41
42Release authorization is given by the Node.js TSC. Once authorized, an
43individual must have the following:
44
45### 1. Jenkins release access
46
47There are three relevant Jenkins jobs that should be used for a release flow:
48
49**a.** **Test runs:**
50**[node-test-pull-request](https://ci.nodejs.org/job/node-test-pull-request/)**
51is used for a final full-test run to ensure that the current *HEAD* is stable.
52
53**b.** **Nightly builds:** (optional)
54**[iojs+release](https://ci-release.nodejs.org/job/iojs+release/)** can be used
55to create a nightly release for the current *HEAD* if public test releases are
56required. Builds triggered with this job are published straight to
57<https://nodejs.org/download/nightly/> and are available for public download.
58
59**c.** **Release builds:**
60**[iojs+release](https://ci-release.nodejs.org/job/iojs+release/)** does all of
61the work to build all required release assets. Promotion of the release files is
62a manual step once they are ready (see below).
63
64The [Node.js build team](https://github.com/nodejs/build) is able to provide
65this access to individuals authorized by the TSC.
66
67### 2. <nodejs.org> access
68
69The _dist_ user on nodejs.org controls the assets available in
70<https://nodejs.org/download/>. <https://nodejs.org/dist/> is an alias for
71<https://nodejs.org/download/release/>.
72
73The Jenkins release build workers upload their artifacts to the web server as
74the _staging_ user. The _dist_ user has access to move these assets to public
75access while, for security, the _staging_ user does not.
76
77Nightly builds are promoted automatically on the server by a cron task for the
78_dist_ user.
79
80Release builds require manual promotion by an individual with SSH access to the
81server as the _dist_ user. The
82[Node.js build team](https://github.com/nodejs/build) is able to provide this
83access to individuals authorized by the TSC.
84
85### 3. A publicly-listed GPG key
86
87A `SHASUMS256.txt` file is produced for every promoted build, nightly, and
88releases. Additionally for releases, this file is signed by the individual
89responsible for that release. In order to be able to verify downloaded binaries,
90the public should be able to check that the `SHASUMS256.txt` file has been
91signed by someone who has been authorized to create a release.
92
93The GPG keys should be fetchable from a known third-party keyserver. The SKS
94Keyservers at <https://sks-keyservers.net> are recommended. Use the
95[submission](https://pgp.mit.edu/) form to submit a new GPG key. You'll need to
96do an ASCII-armored export of your key first:
97
98```console
99$ gpg --armor --export email@server.com > ~/nodekey.asc
100```
101
102Keys should be fetchable via:
103
104```console
105$ gpg --keyserver pool.sks-keyservers.net --recv-keys <FINGERPRINT>
106```
107
108The key you use may be a child/subkey of an existing key.
109
110Additionally, full GPG key fingerprints for individuals authorized to release
111should be listed in the Node.js GitHub README.md file.
112
113## How to create a release
114
115Notes:
116
117* Dates listed below as _"YYYY-MM-DD"_ should be the date of the release **as
118  UTC**. Use `date -u +'%Y-%m-%d'` to find out what this is.
119* Version strings are listed below as _"vx.y.z"_ or _"x.y.z"_. Substitute for
120  the release version.
121* Examples will use the fictional release version `1.2.3`.
122
123### 0. Pre-release steps
124
125Before preparing a Node.js release, the Build Working Group must be notified at
126least one business day in advance of the expected release. Coordinating with
127Build is essential to make sure that the CI works, release files are published,
128and the release blog post is available on the project website.
129
130Build can be contacted best by opening up an issue on the [Build issue
131tracker][].
132
133When preparing a security release, contact Build at least two weekdays in
134advance of the expected release. To ensure that the security patch(es) can be
135properly tested, run a `node-test-pull-request` job against the `master` branch
136of the `nodejs-private/node-private` repository a day or so before the
137[CI lockdown procedure][] begins. This is to confirm that Jenkins can properly
138access the private repository.
139
140### 1. Update the staging branch
141
142Checkout the staging branch locally.
143
144```console
145$ git remote update
146$ git checkout v1.x-staging
147$ git reset --hard upstream/v1.x-staging
148```
149
150If the staging branch is not up to date relative to `master`, bring the
151appropriate PRs and commits into it.
152
153Go through PRs with the label `vN.x`. e.g. [PRs with the `v8.x` label](https://github.com/nodejs/node/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3Av8.x).
154
155For each PR:
156
157* Run or check that there is a passing CI.
158* Check approvals (you can approve yourself).
159* Check that the commit metadata was not changed from the `master` commit.
160* If there are merge conflicts, ask the PR author to rebase.
161Simple conflicts can be resolved when landing.
162
163When landing the PR add the `Backport-PR-URL:` line to each commit. Close the
164backport PR with `Landed in ...`. Update the label on the original PR from
165`backport-requested-vN.x` to `backported-to-vN.x`.
166
167To determine the relevant commits, use
168[`branch-diff`](https://github.com/nodejs/branch-diff). The tool is available on
169npm and should be installed globally or run with `npx`. It depends on our commit
170metadata, as well as the GitHub labels such as `semver-minor` and
171`semver-major`. One drawback is that when the `PR-URL` metadata is accidentally
172omitted from a commit, the commit will show up because it's unsure if it's a
173duplicate or not.
174
175For a list of commits that could be landed in a patch release on v1.x:
176
177```console
178$ branch-diff v1.x-staging master --exclude-label=semver-major,semver-minor,dont-land-on-v1.x,backport-requested-v1.x,backport-blocked-v1.x,backport-open-v1.x,backported-to-v1.x --filter-release --format=simple
179```
180
181Previously released commits and version bumps do not need to be
182cherry-picked.
183
184Carefully review the list of commits:
185
186* Checking for errors (incorrect `PR-URL`)
187* Checking semver status - Commits labeled as `semver-minor` or `semver-major`
188should only be cherry-picked when appropriate for the type of release being
189made.
190* If you think it's risky and the change should wait for a while, add the
191`baking-for-lts` tag.
192
193When you are ready to cherry-pick commits, you can automate with the following
194command. (For semver-minor releases, make sure to remove the `semver-minor` tag
195from `exclude-label`.)
196
197```console
198$ branch-diff v1.x-staging master --exclude-label=semver-major,semver-minor,dont-land-on-v1.x,backport-requested-v1.x,backport-blocked-v1.x,backport-open-v1.x,backported-to-v1.x --filter-release --format=sha --reverse | xargs git cherry-pick
199```
200
201When cherry-picking commits, if there are simple conflicts you can resolve
202them. Otherwise, add the `backport-requested-vN.x` label to the original PR
203and post a comment stating that it does not land cleanly and will require a
204backport PR. You can refer the owner of the PR to the "[Backporting to Release
205 Lines](https://github.com/nodejs/node/blob/HEAD/doc/guides/backporting-to-release-lines.md)" guide.
206
207If commits were cherry-picked in this step, check that the test still pass.
208
209```console
210$ make test
211```
212
213Then, push to the staging branch to keep it up-to-date.
214
215```console
216$ git push upstream v1.x-staging
217```
218
219### 2. Create a new branch for the release
220
221Create a new branch named `vx.y.z-proposal`, off the corresponding staging
222branch.
223
224```console
225$ git checkout -b v1.2.3-proposal upstream/v1.x-staging
226```
227
228### 3. Update `src/node_version.h`
229
230Set the version for the proposed release using the following macros, which are
231already defined in `src/node_version.h`:
232
233```c
234#define NODE_MAJOR_VERSION x
235#define NODE_MINOR_VERSION y
236#define NODE_PATCH_VERSION z
237```
238
239Set the `NODE_VERSION_IS_RELEASE` macro value to `1`. This causes the build to
240be produced with a version string that does not have a trailing pre-release tag:
241
242```c
243#define NODE_VERSION_IS_RELEASE 1
244```
245
246### 4. Update the changelog
247
248#### Step 1: Collect the formatted list of changes
249
250Collect a formatted list of commits since the last release. Use
251[`changelog-maker`](https://github.com/nodejs/changelog-maker) to do this:
252
253```console
254$ changelog-maker --group
255```
256
257`changelog-maker` counts commits since the last tag and if the last tag
258in the repository was not on the current branch you may have to supply a
259`--start-ref` argument:
260
261```console
262$ changelog-maker --group --filter-release --start-ref v1.2.2
263```
264
265`--filter-release` will remove the release commit from the previous release.
266
267#### Step 2: Update the appropriate doc/changelogs/CHANGELOG_*.md file
268
269There is a separate `CHANGELOG_Vx.md` file for each major Node.js release line.
270These are located in the `doc/changelogs/` directory. Once the formatted list of
271changes is collected, it must be added to the top of the relevant changelog file
272in the release branch (e.g. a release for Node.js v4 would be added to the
273`/doc/changelogs/CHANGELOG_V4.md`).
274
275**Please do *not* add the changelog entries to the root `CHANGELOG.md` file.**
276
277The new entry should take the following form:
278
279```markdown
280<a id="x.y.x"></a>
281## YYYY-MM-DD, Version x.y.z (Release Type), @releaser
282
283### Notable changes
284
285* List interesting changes here
286* Particularly changes that are responsible for minor or major version bumps
287* Also be sure to look at any changes introduced by dependencies such as npm
288* ... and include any notable items from there
289
290### Commits
291
292* Include the full list of commits since the last release here. Do not include "Working on X.Y.Z+1" commits.
293```
294
295The release type should be either Current, LTS, or Maintenance, depending on the
296type of release being produced.
297
298You can use `branch-diff` to get a list of commits with the `notable-change`
299label:
300
301```console
302$ branch-diff upstream/v1.x v1.2.3-proposal --require-label=notable-change -format=simple
303```
304
305Be sure that the `<a>` tag, as well as the two headings, are not indented at
306all.
307
308At the top of the root `CHANGELOG.md` file, there is a table indexing all
309releases in each major release line. A link to the new release needs to be added
310to it. Follow the existing examples and be sure to add the release to the *top*
311of the list. The most recent release for each release line is shown in **bold**
312in the index. When updating the index, please make sure to update the display
313accordingly by removing the bold styling from the previous release.
314
315#### Step 3: Update any REPLACEME and DEP00XX tags in the docs
316
317If this release includes new APIs then it is necessary to document that they
318were first added in this version. The relevant commits should already include
319`REPLACEME` tags as per the example in the
320[docs README](../../tools/doc/README.md). Check for these tags with
321```console
322grep REPLACEME doc/api/*.md
323```
324and substitute this node version with
325```console
326sed -i "s/REPLACEME/$VERSION/g" doc/api/*.md` or `perl -pi -e "s/REPLACEME/$VERSION/g" doc/api/*.md
327```
328
329`$VERSION` should be prefixed with a `v`.
330
331If this release includes any new deprecations it is necessary to ensure that
332those are assigned a proper static deprecation code. These are listed in the
333docs (see `doc/api/deprecations.md`) and in the source as `DEP00XX`. The code
334must be assigned a number (e.g. `DEP0012`). This assignment should
335occur when the PR is landed, but a check will be made when the release build is
336run.
337
338### 5. Create release commit
339
340The `CHANGELOG.md`, `doc/changelogs/CHANGELOG_Vx.md`, `src/node_version.h`, and
341`REPLACEME` changes should be the final commit that will be tagged for the
342release. When committing these to git, use the following message format:
343
344```text
345YYYY-MM-DD, Version x.y.z (Release Type)
346
347Notable changes:
348
349* Copy the notable changes list here, reformatted for plain-text
350```
351
352For security releases, begin the commit message with the phrase
353`This is a security release.` to allow the
354[distribution indexer](https://github.com/nodejs/nodejs-dist-indexer) to
355identify it as such:
356
357```text
358YYYY-MM-DD, Version x.y.z (Release Type)
359
360This is a security release.
361
362Notable changes:
363
364* Copy the notable changes list here, reformatted for plain-text
365```
366
367### 6. Propose release on GitHub
368
369Push the release branch to `nodejs/node`, not to your own fork. This allows
370release branches to more easily be passed between members of the release team if
371necessary.
372
373Create a pull request targeting the correct release line. For example, a
374`v5.3.0-proposal` PR should target `v5.x`, not master. Paste the CHANGELOG
375modifications into the body of the PR so that collaborators can see what is
376changing. These PRs should be left open for at least 24 hours, and can be
377updated as new commits land. If the CHANGELOG pasted into the pull request
378is long enough that it slows down the GitHub UI, consider pasting the commits
379into `<details>` tags or in follow up comments.
380
381If using the `<details>` tag, use the following format:
382
383```markdown
384<details>
385<summary>Commits</summary>
386
387* Full list of commits...
388</details>
389```
390
391If you need any additional information about any of the commits, this PR is a
392good place to @-mention the relevant contributors.
393
394After opening the PR, update the release commit to include `PR-URL` metadata and
395force-push the proposal.
396
397### 7. Ensure that the release branch is stable
398
399Run a **[`node-test-pull-request`](https://ci.nodejs.org/job/node-test-pull-request/)**
400test run to ensure that the build is stable and the HEAD commit is ready for
401release.
402
403Also run a **[`node-test-commit-v8-linux`](https://ci.nodejs.org/job/node-test-commit-v8-linux/)**
404test run if the release contains changes to `deps/v8`.
405
406Perform some smoke-testing. There is the
407**[`citgm-smoker`](https://ci.nodejs.org/job/citgm-smoker/)** CI job for this
408purpose. Run it once with the base `vx.x` branch as a reference and with the
409proposal branch to check if new regressions could be introduced in the
410ecosystem.
411
412### 8. Produce a nightly build _(optional)_
413
414If there is a reason to produce a test release for the purpose of having others
415try out installers or specifics of builds, produce a nightly build using
416**[iojs+release](https://ci-release.nodejs.org/job/iojs+release/)** and wait for
417it to drop in <https://nodejs.org/download/nightly/>. Follow the directions and
418enter a proper length commit SHA, enter a date string, and select "nightly" for
419"disttype".
420
421This is particularly recommended if there has been recent work relating to the
422macOS or Windows installers as they are not tested in any way by CI.
423
424### 9. Produce release builds
425
426Use **[iojs+release](https://ci-release.nodejs.org/job/iojs+release/)** to
427produce release artifacts. Enter the commit that you want to build from and
428select "release" for "disttype".
429
430Artifacts from each worker are uploaded to Jenkins and are available if further
431testing is required. Use this opportunity particularly to test macOS and Windows
432installers if there are any concerns. Click through to the individual workers
433for a run to find the artifacts.
434
435All release workers should achieve "SUCCESS" (and be green, not red). A release
436with failures should not be promoted as there are likely problems to be
437investigated.
438
439You can rebuild the release as many times as you need prior to promoting them if
440you encounter problems.
441
442If you have an error on Windows and need to start again, be aware that you'll
443get immediate failure unless you wait up to 2 minutes for the linker to stop
444from previous jobs. i.e. if a build fails after having started compiling, that
445worker will still have a linker process that's running for another couple of
446minutes which will prevent Jenkins from clearing the workspace to start a new
447one. This isn't a big deal, it's just a hassle because it'll result in another
448failed build if you start again!
449
450### 10. Test the build
451
452Jenkins collects the artifacts from the builds, allowing you to download and
453install the new build. Make sure that the build appears correct. Check the
454version numbers, and perform some basic checks to confirm that all is well with
455the build before moving forward.
456
457### 11. Tag and sign the release commit
458
459Once you have produced builds that you're happy with, create a new tag. By
460waiting until this stage to create tags, you can discard a proposed release if
461something goes wrong or additional commits are required. Once you have created a
462tag and pushed it to GitHub, you ***must not*** delete and re-tag. If you make
463a mistake after tagging then you'll have to version-bump and start again and
464count that tag/version as lost.
465
466Tag summaries have a predictable format, look at a recent tag to see, `git tag
467-v v6.0.0`. The message should look something like `2016-04-26 Node.js v6.0.0
468(Current) Release`.
469
470Install `git-secure-tag` npm module:
471
472```console
473$ npm install -g git-secure-tag
474```
475
476Create a tag using the following command:
477
478```console
479$ git secure-tag <vx.y.z> <commit-sha> -sm "YYYY-MM-DD Node.js vx.y.z (<release-type>) Release"
480```
481
482`release-type` is either "Current" or "LTS". For LTS releases, you should also
483 include the release code name.
484
485```text
4862019-10-22 Node.js v10.17.0 'Dubnium' (LTS) Release
487```
488
489The tag **must** be signed using the GPG key that's listed for you on the
490project README.
491
492### 12. Set up for the next release
493
494On release proposal branch, edit `src/node_version.h` again and:
495
496* Increment `NODE_PATCH_VERSION` by one
497* Change `NODE_VERSION_IS_RELEASE` back to `0`
498
499Commit this change with the following commit message format:
500
501```text
502Working on vx.y.z # where 'z' is the incremented patch number
503
504PR-URL: <full URL to your release proposal PR>
505```
506
507This sets up the branch so that nightly builds are produced with the next
508version number _and_ a pre-release tag.
509
510Merge your release proposal branch into the stable branch that you are releasing
511from and rebase the corresponding staging branch on top of that.
512
513```console
514$ git checkout v1.x
515$ git merge --ff-only v1.2.3-proposal
516$ git push upstream v1.x
517$ git checkout v1.x-staging
518$ git rebase v1.x
519$ git push upstream v1.x-staging
520```
521
522### 13. Cherry-pick the release commit to `master`
523
524```console
525$ git checkout master
526$ git cherry-pick v1.x^
527```
528
529Git should stop to let you fix conflicts. Revert all changes that were made to
530`src/node_version.h`:
531
532```console
533$ git checkout --ours HEAD -- src/node_version.h
534```
535
536If there are conflicts in `doc` due to updated `REPLACEME`
537placeholders (that happens when a change previously landed on another release
538branch), keep both version numbers. Convert the YAML field to an array if it is
539not already one.
540
541Then finish cherry-picking and push the commit upstream:
542
543```console
544$ git add src/node_version.h doc
545$ git cherry-pick --continue
546$ make lint
547$ git push upstream master
548```
549
550**Do not** cherry-pick the "Working on vx.y.z" commit to `master`.
551
552### 14. Push the release tag
553
554Push the tag to the repository before you promote the builds. If you
555haven't pushed your tag first, then build promotion won't work properly.
556Push the tag using the following command:
557
558```console
559$ git push <remote> <vx.y.z>
560```
561
562*Note*: Please do not push the tag unless you are ready to complete the
563remainder of the release steps.
564
565### 15. Promote and sign the release builds
566
567**The same individual who signed the release tag must be the one
568to promote the builds as the `SHASUMS256.txt` file needs to be signed with the
569same GPG key!**
570
571Use `tools/release.sh` to promote and sign the build. Before doing this, you'll
572need to ensure you've loaded the correct ssh key, or you'll see the following:
573
574```console
575# Checking for releases ...
576Enter passphrase for key '/Users/<user>/.ssh/id_rsa':
577dist@direct.nodejs.org's password:
578```
579
580The key can be loaded either with `ssh-add`:
581
582```console
583# Substitute node_id_rsa with whatever you've named the key
584$ ssh-add ~/.ssh/node_id_rsa
585```
586
587or at runtime with:
588
589```console
590# Substitute node_id_rsa with whatever you've named the key
591$ ./tools/release.sh -i ~/.ssh/node_id_rsa
592```
593
594`tools/release.sh` will perform the following actions when run:
595
596<details>
597
598**a.** Select a GPG key from your private keys. It will use a command similar
599to: `gpg --list-secret-keys` to list your keys. If you don't have any keys, it
600will bail. If you have only one key, it will use that. If you have more than
601one key it will ask you to select one from the list. Be sure to use the same
602key that you signed your git tag with.
603
604**b.** Log in to the server via SSH and check for releases that can be promoted,
605along with the list of artifacts. It will use the `dist-promotable` command on
606the server to find these. You will be asked, for each promotable release,
607whether you want to proceed. If there is more than one release to promote (there
608shouldn't be), be sure to only promote the release you are responsible for.
609
610**c.** Log in to the server via SSH and run the promote script for the given
611release. The command on the server will be similar to: `dist-promote vx.y.z`.
612After this step, the release artifacts will be available for download and a
613`SHASUMS256.txt` file will be present. The release will still be unsigned,
614however.
615
616**d.** Use `scp` to download `SHASUMS256.txt` to a temporary directory on your
617computer.
618
619**e.** Sign the `SHASUMS256.txt` file using a command similar to: `gpg
620--default-key YOURKEY --digest-algo SHA256 --clearsign /path/to/SHASUMS256.txt`.
621You will be prompted by GPG for your password. The signed file will be named
622SHASUMS256.txt.asc.
623
624**f.** Output an ASCII armored version of your public GPG key using a command
625similar to: `gpg --default-key YOURKEY --digest-algo SHA256 --detach-sign /path/to/SHASUMS256.txt`.
626You will be prompted by GPG for your password. The signed file will be named
627SHASUMS256.txt.sig.
628
629**g.** Upload the `SHASUMS256.txt` files back to the server into the release
630directory.
631</details>
632
633**It is possible to only sign a release by running `./tools/release.sh -s
634vX.Y.Z`.**
635
636### 16. Check the release
637
638Your release should be available at `https://nodejs.org/dist/vx.y.z/` and
639<https://nodejs.org/dist/latest/>. Check that the appropriate files are in
640place. You may want to check that the binaries are working as appropriate and
641have the right internal version strings. Check that the API docs are available
642at <https://nodejs.org/api/>. Check that the release catalog files are correct
643at <https://nodejs.org/dist/index.tab> and <https://nodejs.org/dist/index.json>.
644
645### 17. Create a blog post
646
647There is an automatic build that is kicked off when you promote new builds, so
648within a few minutes nodejs.org will be listing your new version as the latest
649release. However, the blog post is not yet fully automatic.
650
651Create a new blog post by running the [nodejs.org release-post.js script][].
652This script will use the promoted builds and changelog to generate the post. Run
653`npm run serve` to preview the post locally before pushing to the
654[nodejs.org repository][].
655
656* You can add a short blurb just under the main heading if you want to say
657  something important, otherwise the text should be publication ready.
658* The links to the download files won't be complete unless you waited for the
659  ARMv6 builds. Any downloads that are missing will have `*Coming soon*` next to
660  them. It's your responsibility to manually update these later when you have
661  the outstanding builds.
662* The `SHASUMS256.txt.asc` content is at the bottom of the post. When you update
663  the list of tarballs you'll need to copy/paste the new contents of this file
664  to reflect those changes.
665* Always use pull-requests on the [nodejs.org repository][]. Be respectful
666  of the website team, but you do not have to wait for PR sign-off. Please
667  use the following commit message format:
668
669  ```console
670  Blog: vX.Y.Z release post
671
672  Refs: <full URL to your release proposal PR>
673  ```
674
675* Changes to `master` on the [nodejs.org repository][] will trigger a new build
676  of nodejs.org so your changes should appear a few minutes after pushing.
677
678### 18. Create the release on GitHub
679
680* Go to the [New release page](https://github.com/nodejs/node/releases/new).
681* Select the tag version you pushed earlier.
682* For release title, copy the title from the changelog.
683* For the description, copy the rest of the changelog entry.
684* Click on the "Publish release" button.
685
686### 19. Cleanup
687
688Close your release proposal PR and delete the proposal branch.
689
690### 20. Announce
691
692The nodejs.org website will automatically rebuild and include the new version.
693To announce the build on Twitter through the official @nodejs account, email
694[pr@nodejs.org](mailto:pr@nodejs.org) with a message such as:
695
696> v5.8.0 of @nodejs is out: <https://nodejs.org/en/blog/release/v5.8.0/>
697> …
698> something here about notable changes
699
700To ensure communication goes out with the timing of the blog post, please allow
70124 hour prior notice. If known, please include the date and time the release
702will be shared with the community in the email to coordinate these
703announcements.
704
705Ping the IRC ops and the other [Partner Communities][] liaisons.
706
707### 21. Celebrate
708
709_In whatever form you do this..._
710
711## LTS Releases
712
713### Marking a release line as LTS
714
715To mark a release line as LTS, the following changes must be made to
716`src/node_version.h`:
717
718* The `NODE_MINOR_VERSION` macro must be incremented by one
719* The `NODE_PATCH_VERSION` macro must be set to `0`
720* The `NODE_VERSION_IS_LTS` macro must be set to `1`
721* The `NODE_VERSION_LTS_CODENAME` macro must be set to the code name selected
722for the LTS release.
723
724For example:
725
726```diff
727-#define NODE_MINOR_VERSION 12
728-#define NODE_PATCH_VERSION 1
729+#define NODE_MINOR_VERSION 13
730+#define NODE_PATCH_VERSION 0
731
732-#define NODE_VERSION_IS_LTS 0
733-#define NODE_VERSION_LTS_CODENAME ""
734+#define NODE_VERSION_IS_LTS 1
735+#define NODE_VERSION_LTS_CODENAME "Erbium"
736
737-#define NODE_VERSION_IS_RELEASE 0
738+#define NODE_VERSION_IS_RELEASE 1
739```
740
741The changes must be made as part of a new semver-minor release.
742
743### Update release labels
744
745The `lts-watch-vN.x` issue label must be created, with the same color as other
746existing labels for that release line, such as `vN.x`.
747
748If the release is transitioning from Active LTS to Maintenance, the
749`backport-requested-vN.x` label must be deleted.
750
751## Major releases
752
753The process for cutting a new Node.js major release has a number of differences
754from cutting a minor or patch release.
755
756### Schedule
757
758New Node.js Major releases happen twice per year:
759
760* Even-numbered releases are cut in April.
761* Odd-numbered releases are cut in October.
762
763Major releases should be targeted for the third Tuesday of the release month.
764
765A major release must not slip beyond the release month. In other words, major
766releases must not slip into May or November.
767
768The release date for the next major release should be announced immediately
769following the current release (e.g. the release date for 13.0.0 should be
770announced immediately following the release of 12.0.0).
771
772### Release branch
773
774Approximately three months before a major release, new `vN.x` and
775`vN.x-staging` branches (where `N` indicates the major release) should be
776created as forks of the `master` branch. Up until one month before the release
777date, these must be kept in sync with `master` and must not be considered to
778be stable branches (e.g. they may be force pushed).
779
780The `vN.x` and `vN.x-staging` branches must be kept in sync with one another
781up until the date of release.
782
783One month or less before the release date, commits must be cherry-picked into
784the two branches. To land `SEMVER-MAJOR` at this time requires no objections
785from the TSC.
786
787### Create release labels
788
789The following issue labels must be created:
790
791* `vN.x`
792* `backport-blocked-vN.x`
793* `backport-open-vN.x`
794* `backport-requested-vN.x`
795* `backported-to-vN.x`
796* `dont-land-on-vN.x`
797
798The label description can be copied from existing labels of previous releases.
799The label color must be the same for all new labels, but different from the
800labels of previous releases.
801
802### Release proposal
803
804A draft release proposal should be created two months before the release. A
805separate `vN.x-proposal` branch should be created that tracks the `vN.x`
806branch. This branch will contain the draft release commit (with the draft
807changelog).
808
809Notify the `@nodejs/npm` team in the release proposal PR to inform them of the
810upcoming release. `npm` maintains a list of [supported versions](https://github.com/npm/cli/blob/latest/lib/utils/unsupported.js#L3)
811that will need updating to include the new major release.
812
813### Update `NODE_MODULE_VERSION`
814
815This macro in `src/node_version.h` is used to signal an ABI version for native
816addons. It currently has two common uses in the community:
817
818* Determining what API to work against for compiling native addons, e.g.
819  [NAN](https://github.com/nodejs/nan) uses it to form a compatibility-layer for
820  much of what it wraps.
821* Determining the ABI for downloading pre-built binaries of native addons, e.g.
822  [node-pre-gyp](https://github.com/mapbox/node-pre-gyp) uses this value as
823  exposed via `process.versions.modules` to help determine the appropriate
824  binary to download at install-time.
825
826The general rule is to bump this version when there are _breaking ABI_ changes
827and also if there are non-trivial API changes. The rules are not yet strictly
828defined, so if in doubt, please confer with someone that will have a more
829informed perspective, such as a member of the NAN team.
830
831A registry of currently used `NODE_MODULE_VERSION` values is maintained at
832<https://github.com/nodejs/node/blob/HEAD/doc/abi_version_registry.json>.
833When bumping `NODE_MODULE_VERSION`, you should choose a new value not listed
834in the registry. Also include a change to the registry in your commit to
835reflect the newly used value. Ensure that the release commit removes the
836`-pre` suffix for the major version being prepared.
837
838It is current TSC policy to bump major version when ABI changes. If you
839see a need to bump `NODE_MODULE_VERSION` outside of a majore release then
840you should consult the TSC. Commits may need to be reverted or a major
841version bump may need to happen.
842
843### Test releases and release candidates
844
845Test builds should be generated from the `vN.x-proposal` branch starting at
846about 6 weeks before the release.
847
848Release Candidates should be generated from the `vN.x-proposal` branch starting
849at about 4 weeks before the release, with a target of one release candidate
850per week.
851
852Always run test releases and release candidates through the Canary in the
853Goldmine tool for additional testing.
854
855### Changelogs
856
857Generating major release changelogs is a bit more involved than minor and patch
858changelogs.
859
860#### Create the changelog file
861
862In the `doc/changelogs` directory, create a new `CHANGELOG_V{N}.md` file where
863`{N}` is the major version of the release. Follow the structure of the existing
864`CHANGELOG_V*.md` files.
865
866The navigation headers in all of the `CHANGELOG_V*.md` files must be
867updated to account for the new `CHANGELOG_V{N}.md` file.
868
869Once the file is created, the root `CHANGELOG.md` file must be updated to
870reference the newly-created major release `CHANGELOG_V{N}.md`.
871
872#### Generate the changelog
873
874To generate a proper major release changelog, use the `branch-diff` tool to
875compare the `vN.x` branch against the `vN-1.x` branch (e.g. for Node.js 12.0,
876we compare the `v12.x` branch against the up to date `v11.x` branch). Make sure
877that the local copy of the downlevel branch is up to date.
878
879The commits in the generated changelog must then be organized:
880
881* Remove all release commits from the list
882* Remove all reverted commits and their reverts
883* Separate all SEMVER-MAJOR, SEMVER-MINOR, and SEMVER-PATCH commits into lists
884
885#### Generate the notable changes
886
887For a major release, all SEMVER-MAJOR commits that are not strictly internal,
888test, or doc-related are to be listed as notable changes. Some SEMVER-MINOR
889commits may be listed as notable changes on a case-by-case basis. Use your
890judgment there.
891
892### Snap
893
894The Node.js [Snap][] package has a "default" for installs where the user hasn't
895specified a release line ("track" in Snap terminology). This should be updated
896to point to the most recently activated LTS. A member of the Node.js Build
897Infrastructure team is able to perform the switch of the default. An issue
898should be opened on the [Node.js Snap management repository][] requesting this
899take place once a new LTS line has been released.
900
901[Build issue tracker]: https://github.com/nodejs/build/issues/new
902[CI lockdown procedure]: https://github.com/nodejs/build/blob/HEAD/doc/jenkins-guide.md#restricting-access-for-security-releases
903[Node.js Snap management repository]: https://github.com/nodejs/snap
904[Partner Communities]: https://github.com/nodejs/community-committee/blob/HEAD/governance/PARTNER_COMMUNITIES.md
905[Snap]: https://snapcraft.io/node
906[nodejs.org release-post.js script]: https://github.com/nodejs/nodejs.org/blob/HEAD/scripts/release-post.js
907[nodejs.org repository]: https://github.com/nodejs/nodejs.org
908