Skip to content

Commit dca9643

Browse files
committed
meta: add support for alpha prerelease tag
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 18f938d commit dca9643

2 files changed

Lines changed: 88 additions & 72 deletions

File tree

doc/contributing/releases.md

Lines changed: 72 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ already defined in `src/node_version.h`:
357357
#define NODE_MAJOR_VERSION x
358358
#define NODE_MINOR_VERSION y
359359
#define NODE_PATCH_VERSION z
360+
361+
// And for alpha releases:
362+
#define NODE_ALPHA_MAJOR_VERSION a
363+
#define NODE_ALPHA_MINOR_VERSION b
364+
#define NODE_ALPHA_PATCH_VERSION c
360365
```
361366
362367
Set the `NODE_VERSION_IS_RELEASE` macro value to `1`. This causes the build to
@@ -366,6 +371,14 @@ be produced with a version string that does not have a trailing pre-release tag:
366371
#define NODE_VERSION_IS_RELEASE 1
367372
```
368373

374+
<details>
375+
<summary>Major version release</summary>
376+
377+
Remove the `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
378+
`NODE_ALPHA_PATCH_VERSION` macros.
379+
380+
</details>
381+
369382
### 4. Update the changelog
370383

371384
#### Step 1: Collect the formatted list of changes
@@ -825,8 +838,8 @@ project README.
825838

826839
On release proposal branch, edit `src/node_version.h` again and:
827840

828-
* Increment `NODE_PATCH_VERSION` by one
829-
* Change `NODE_VERSION_IS_RELEASE` back to `0`
841+
* Increment `NODE_PATCH_VERSION` (or `NODE_ALPHA_PATCH_VERSION` for alpha releases) by one.
842+
* Change `NODE_VERSION_IS_RELEASE` back to `0`.
830843

831844
Commit this change with the following commit message format:
832845

@@ -893,9 +906,11 @@ git restore --source=upstream/main src/node_version.h
893906
On the main branch, instead of reverting changes made to `src/node_version.h`
894907
edit it instead and:
895908

896-
* Increment `NODE_MAJOR_VERSION` by one
897-
* Reset `NODE_PATCH_VERSION` to `0`
898-
* Change `NODE_VERSION_IS_RELEASE` back to `0`
909+
* Increment `NODE_MAJOR_VERSION` by one.
910+
* Reset `NODE_PATCH_VERSION` and `NODE_MINOR_VERSION` to `0`.
911+
* Set `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
912+
`NODE_ALPHA_PATCH_VERSION` to `0`.
913+
* Change `NODE_VERSION_IS_RELEASE` back to `0`.
899914

900915
Amend the current commit to apply the changes:
901916

@@ -1194,9 +1209,9 @@ git node release --prepare --startLTS
11941209
To mark a release line as LTS, the following changes must be made to
11951210
`src/node_version.h`:
11961211

1197-
* The `NODE_MINOR_VERSION` macro must be incremented by one
1198-
* The `NODE_PATCH_VERSION` macro must be set to `0`
1199-
* The `NODE_VERSION_IS_LTS` macro must be set to `1`
1212+
* The `NODE_MINOR_VERSION` macro must be incremented by one.
1213+
* The `NODE_PATCH_VERSION` macro must be set to `0`.
1214+
* The `NODE_VERSION_IS_LTS` macro must be set to `1`.
12001215
* The `NODE_VERSION_LTS_CODENAME` macro must be set to the code name selected
12011216
for the LTS release.
12021217

@@ -1265,15 +1280,15 @@ from cutting a minor or patch release.
12651280

12661281
### Schedule
12671282

1268-
New Node.js Major releases happen twice per year:
1283+
New Node.js Major releases happen once per year:
12691284

1270-
* Even-numbered releases are cut in April.
1271-
* Odd-numbered releases are cut in October.
1285+
* Branch-off is in October.
1286+
* Semver-major release is in April.
12721287

12731288
Major releases should be targeted for the third Tuesday of the release month.
12741289

12751290
A major release must not slip beyond the release month. In other words, major
1276-
releases must not slip into May or November.
1291+
releases must not slip into May.
12771292

12781293
The @nodejs/releasers make a call for releasers 3 months in advance.
12791294
Currently, this call is automated in the `#nodejs-release-private`
@@ -1283,26 +1298,25 @@ The release date for the next major release should be announced immediately
12831298
following the current release (e.g. the release date for 13.0.0 should be
12841299
announced immediately following the release of 12.0.0).
12851300

1286-
### Release branch
1301+
### Branch-off
12871302

1288-
Approximately two months before a major release, new `vN.x` and
1289-
`vN.x-staging` branches (where `N` indicates the major release) should be
1290-
created as forks of the `main` branch. Up until the cut-off date announced by
1291-
the releaser, these must be kept in sync with `main`.
1303+
#### Release branch
12921304

1293-
The `vN.x` and `vN.x-staging` branches must be kept in sync with one another
1294-
up until the date of the release.
1305+
Approximately six months before a major release, new `vN.x` and
1306+
`vN.x-staging` branches (where `N` indicates the major release) should be
1307+
created as forks of the `main` branch. Alpha releases should be released picking
1308+
up commits from `main`. Target the first alpha release to be released the same
1309+
day as the previous release line is graduated to LTS status.
12951310

12961311
If a `SEMVER-MAJOR` pull request lands on the default branch within one month
12971312
prior to the major release date, it must not be included on the new major
12981313
staging branch, unless there is consensus from the Node.js releasers team to
12991314
do so. This measure aims to ensure better stability for the release candidate
13001315
(RC) phase, which begins approximately two weeks prior to the official release.
13011316
By restricting `SEMVER-MAJOR` commits in this period, we provide more time for
1302-
thorough testing and reduce the potential for major breakages, especially in
1303-
LTS lines.
1317+
thorough testing and reduce the potential for major breakages.
13041318

1305-
### Create release labels
1319+
#### Create release labels
13061320

13071321
The following issue labels must be created:
13081322

@@ -1317,7 +1331,40 @@ The label description can be copied from existing labels of previous releases.
13171331
The label color must be the same for all new labels, but different from the
13181332
labels of previous releases.
13191333

1320-
### Release proposal
1334+
#### Create the changelog file
1335+
1336+
In the `doc/changelogs` directory, create a new `CHANGELOG_V{N}.md` file where
1337+
`{N}` is the major version of the release. Follow the structure of the existing
1338+
`CHANGELOG_V*.md` files.
1339+
1340+
The navigation headers in all of the `CHANGELOG_V*.md` files must be
1341+
updated to account for the new `CHANGELOG_V{N}.md` file.
1342+
1343+
Once the file is created, the root `CHANGELOG.md` file must be updated to
1344+
reference the newly-created major release `CHANGELOG_V{N}.md`.
1345+
1346+
#### Generate the changelog
1347+
1348+
To generate a proper major release changelog, use the `branch-diff` tool to
1349+
compare the `vN.x` branch against the `vN-1.x` branch (e.g. for Node.js 12.0,
1350+
we compare the `v12.x` branch against the up to date `v11.x` branch). Make sure
1351+
that the local copy of the downlevel branch is up to date.
1352+
1353+
The commits in the generated changelog must then be organized:
1354+
1355+
* Remove all release commits from the list
1356+
* Remove all reverted commits and their reverts
1357+
* Separate all SEMVER-MAJOR, SEMVER-MINOR, and SEMVER-PATCH commits into lists
1358+
1359+
```console
1360+
$ branch-diff upstream/vN-1.x upstream/vN.x --require-label=semver-major --group --filter-release --markdown # get all majors
1361+
$ branch-diff upstream/vN-1.x upstream/vN.x --require-label=semver-minor --group --filter-release --markdown # get all minors
1362+
$ branch-diff upstream/vN-1.x upstream/vN.x --exclude-label=semver-major,semver-minor --group --filter-release --markdown # get all patches
1363+
```
1364+
1365+
### Semver-major release
1366+
1367+
#### Release proposal
13211368

13221369
A draft release proposal should be created 6 weeks before the release. A
13231370
separate `vN.x-proposal` branch should be created that tracks the `vN.x`
@@ -1342,7 +1389,7 @@ git push upstream vN.x
13421389
git push upstream vN.x-staging
13431390
```
13441391

1345-
### Update `NODE_MODULE_VERSION`
1392+
#### Update `NODE_MODULE_VERSION`
13461393

13471394
This macro in `src/node_version.h` is used to signal an ABI version for native
13481395
addons. It currently has two common uses in the community:
@@ -1372,60 +1419,18 @@ see a need to bump `NODE_MODULE_VERSION` outside of a major release then
13721419
you should consult the TSC. Commits may need to be reverted or a major
13731420
version bump may need to happen.
13741421

1375-
### Test releases and release candidates
1376-
1377-
Test builds should be generated from the `vN.x-proposal` branch starting at
1378-
about 6 weeks before the release.
1379-
1380-
Release Candidates should be generated from the `vN.x-proposal` branch starting
1381-
at about 4 weeks before the release, with a target of one release candidate
1382-
per week.
1383-
1384-
Always run test releases and release candidates through the Canary in the
1385-
Goldmine tool for additional testing.
1386-
13871422
### Changelogs
13881423

13891424
Generating major release changelogs is a bit more involved than minor and patch
13901425
changelogs.
13911426

1392-
#### Create the changelog file
1393-
1394-
In the `doc/changelogs` directory, create a new `CHANGELOG_V{N}.md` file where
1395-
`{N}` is the major version of the release. Follow the structure of the existing
1396-
`CHANGELOG_V*.md` files.
1397-
1398-
The navigation headers in all of the `CHANGELOG_V*.md` files must be
1399-
updated to account for the new `CHANGELOG_V{N}.md` file.
1400-
1401-
Once the file is created, the root `CHANGELOG.md` file must be updated to
1402-
reference the newly-created major release `CHANGELOG_V{N}.md`.
1403-
1404-
#### Generate the changelog
1405-
1406-
To generate a proper major release changelog, use the `branch-diff` tool to
1407-
compare the `vN.x` branch against the `vN-1.x` branch (e.g. for Node.js 12.0,
1408-
we compare the `v12.x` branch against the up to date `v11.x` branch). Make sure
1409-
that the local copy of the downlevel branch is up to date.
1410-
1411-
The commits in the generated changelog must then be organized:
1412-
1413-
* Remove all release commits from the list
1414-
* Remove all reverted commits and their reverts
1415-
* Separate all SEMVER-MAJOR, SEMVER-MINOR, and SEMVER-PATCH commits into lists
1416-
1417-
```console
1418-
$ branch-diff upstream/vN-1.x upstream/vN.x --require-label=semver-major --group --filter-release --markdown # get all majors
1419-
$ branch-diff upstream/vN-1.x upstream/vN.x --require-label=semver-minor --group --filter-release --markdown # get all minors
1420-
$ branch-diff upstream/vN-1.x upstream/vN.x --exclude-label=semver-major,semver-minor --group --filter-release --markdown # get all patches
1421-
```
1422-
14231427
#### Generate the notable changes
14241428

14251429
For a major release, all SEMVER-MAJOR commits that are not strictly internal,
14261430
test, or doc-related are to be listed as notable changes. Some SEMVER-MINOR
14271431
commits may be listed as notable changes on a case-by-case basis. Use your
14281432
judgment there.
1433+
Include the notable changes from the Alpha versions where it applies.
14291434

14301435
### Update the expected assets
14311436

src/node_version.h

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131

3232
#define NODE_VERSION_IS_RELEASE 0
3333

34+
#define NODE_ALPHA_MAJOR_VERSION 0
35+
#define NODE_ALPHA_MINOR_VERSION 0
36+
#define NODE_ALPHA_PATCH_VERSION 0
37+
3438
#ifndef NODE_STRINGIFY
3539
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
3640
#define NODE_STRINGIFY_HELPER(n) #n
@@ -42,17 +46,24 @@
4246

4347
#ifndef NODE_TAG
4448
# if NODE_VERSION_IS_RELEASE
45-
# define NODE_TAG ""
46-
# else
49+
# ifdef NODE_ALPHA_MAJOR_VERSION
50+
# define NODE_TAG "-alpha." \
51+
NODE_STRINGIFY(NODE_ALPHA_MAJOR_VERSION) "." \
52+
NODE_STRINGIFY(NODE_ALPHA_MINOR_VERSION) "." \
53+
NODE_STRINGIFY(NODE_ALPHA_PATCH_VERSION)
54+
# else
55+
# define NODE_TAG ""
56+
# endif // NODE_ALPHA_MAJOR_VERSION
57+
# else // NODE_VERSION_IS_RELEASE
4758
# define NODE_TAG "-pre"
48-
# endif
49-
#else
59+
# endif // NODE_VERSION_IS_RELEASE
60+
#else // NODE_TAG
5061
// NODE_TAG is passed without quotes when rc.exe is run from msbuild
5162
# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
5263
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
5364
NODE_STRINGIFY(NODE_PATCH_VERSION) \
5465
NODE_STRINGIFY(NODE_TAG)
55-
#endif
66+
#endif // NODE_TAG
5667

5768
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
5869
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \

0 commit comments

Comments
 (0)