Skip to content

Commit eff293f

Browse files
authored
meta: add support for alpha prerelease tag
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #63135 Refs: nodejs/Release#1154 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 2749388 commit eff293f

3 files changed

Lines changed: 94 additions & 69 deletions

File tree

.github/workflows/major-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Major Release
22

33
on:
44
schedule:
5-
- cron: 0 0 15 2,8 * # runs at midnight UTC every 15 February and 15 August
5+
- cron: 0 0 15 2 * # runs at midnight UTC every 15 February
66

77
permissions:
88
contents: read

doc/contributing/releases.md

Lines changed: 77 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,11 @@ already defined in `src/node_version.h`:
422422
#define NODE_MAJOR_VERSION x
423423
#define NODE_MINOR_VERSION y
424424
#define NODE_PATCH_VERSION z
425+
426+
// And for alpha releases:
427+
#define NODE_ALPHA_MAJOR_VERSION a
428+
#define NODE_ALPHA_MINOR_VERSION b
429+
#define NODE_ALPHA_PATCH_VERSION c
425430
```
426431
427432
Set the `NODE_VERSION_IS_RELEASE` macro value to `1`. This causes the build to
@@ -431,6 +436,14 @@ be produced with a version string that does not have a trailing pre-release tag:
431436
#define NODE_VERSION_IS_RELEASE 1
432437
```
433438

439+
<details>
440+
<summary>Major version release</summary>
441+
442+
Remove the `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
443+
`NODE_ALPHA_PATCH_VERSION` macros.
444+
445+
</details>
446+
434447
### 4. Update the changelog
435448

436449
_(This step will be done automatically if you are using `create-release-proposal` or `git node release --prepare`)_
@@ -900,8 +913,8 @@ project README.
900913

901914
On release proposal branch, edit `src/node_version.h` again and:
902915

903-
* Increment `NODE_PATCH_VERSION` by one
904-
* Change `NODE_VERSION_IS_RELEASE` back to `0`
916+
* Increment `NODE_PATCH_VERSION` (or `NODE_ALPHA_PATCH_VERSION` for alpha releases) by one.
917+
* Change `NODE_VERSION_IS_RELEASE` back to `0`.
905918

906919
Commit this change with the following commit message format:
907920

@@ -968,9 +981,12 @@ git restore --source=upstream/main src/node_version.h
968981
On the main branch, instead of reverting changes made to `src/node_version.h`
969982
edit it instead and:
970983

971-
* Increment `NODE_MAJOR_VERSION` by one
972-
* Reset `NODE_PATCH_VERSION` to `0`
973-
* Change `NODE_VERSION_IS_RELEASE` back to `0`
984+
* Increment `NODE_MAJOR_VERSION` by one.
985+
* Reset `NODE_PATCH_VERSION` and `NODE_MINOR_VERSION` to `0`.
986+
* Set `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
987+
`NODE_ALPHA_PATCH_VERSION` back to `0` (`main` should already have this, the
988+
release commit will have them removed).
989+
* Change `NODE_VERSION_IS_RELEASE` back to `0`.
974990

975991
Amend the current commit to apply the changes:
976992

@@ -1281,9 +1297,9 @@ git node release --prepare --startLTS
12811297
To mark a release line as LTS, the following changes must be made to
12821298
`src/node_version.h`:
12831299

1284-
* The `NODE_MINOR_VERSION` macro must be incremented by one
1285-
* The `NODE_PATCH_VERSION` macro must be set to `0`
1286-
* The `NODE_VERSION_IS_LTS` macro must be set to `1`
1300+
* The `NODE_MINOR_VERSION` macro must be incremented by one.
1301+
* The `NODE_PATCH_VERSION` macro must be set to `0`.
1302+
* The `NODE_VERSION_IS_LTS` macro must be set to `1`.
12871303
* The `NODE_VERSION_LTS_CODENAME` macro must be set to the code name selected
12881304
for the LTS release.
12891305

@@ -1352,15 +1368,15 @@ from cutting a minor or patch release.
13521368

13531369
### Schedule
13541370

1355-
New Node.js Major releases happen twice per year:
1371+
New Node.js Major releases happen once per year:
13561372

1357-
* Even-numbered releases are cut in April.
1358-
* Odd-numbered releases are cut in October.
1373+
* Branch-off is in October.
1374+
* Semver-major release is in April.
13591375

13601376
Major releases should be targeted for the third Tuesday of the release month.
13611377

13621378
A major release must not slip beyond the release month. In other words, major
1363-
releases must not slip into May or November.
1379+
releases must not slip into May.
13641380

13651381
The @nodejs/releasers make a call for releasers 3 months in advance.
13661382
Currently, this call is automated in the `#nodejs-release-private`
@@ -1370,26 +1386,25 @@ The release date for the next major release should be announced immediately
13701386
following the current release (e.g. the release date for 13.0.0 should be
13711387
announced immediately following the release of 12.0.0).
13721388

1373-
### Release branch
1389+
### Branch-off (October)
13741390

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

1380-
The `vN.x` and `vN.x-staging` branches must be kept in sync with one another
1381-
up until the date of the release.
1393+
Approximately six months before a major release, new `vN.x` and
1394+
`vN.x-staging` branches (where `N` indicates the major release) should be
1395+
created as forks of the `main` branch. Alpha releases should be released picking
1396+
up commits from `main`. Target the first alpha release to be released the same
1397+
day as the previous release line is graduated to LTS status.
13821398

13831399
If a `SEMVER-MAJOR` pull request lands on the default branch within one month
13841400
prior to the major release date, it must not be included on the new major
13851401
staging branch, unless there is consensus from the Node.js releasers team to
13861402
do so. This measure aims to ensure better stability for the release candidate
13871403
(RC) phase, which begins approximately two weeks prior to the official release.
13881404
By restricting `SEMVER-MAJOR` commits in this period, we provide more time for
1389-
thorough testing and reduce the potential for major breakages, especially in
1390-
LTS lines.
1405+
thorough testing and reduce the potential for major breakages.
13911406

1392-
### Create release labels
1407+
#### Create release labels
13931408

13941409
The following issue labels must be created:
13951410

@@ -1404,31 +1419,17 @@ The label description can be copied from existing labels of previous releases.
14041419
The label color must be the same for all new labels, but different from the
14051420
labels of previous releases.
14061421

1407-
### Release proposal
1422+
#### Initial Alpha release proposal
14081423

1409-
A draft release proposal should be created 6 weeks before the release. A
1424+
A draft release proposal should be created before the release. A
14101425
separate `vN.x-proposal` branch should be created that tracks the `vN.x`
14111426
branch. This branch will contain the draft release commit (with the draft
14121427
changelog).
14131428

14141429
Notify the `@nodejs/npm` team in the release proposal PR to inform them of the
14151430
upcoming release.
14161431

1417-
To keep the branch in sync until the release date, it can be as simple as
1418-
doing the following:
1419-
1420-
> Make sure to check that there are no PRs with the label `dont-land-on-vX.x`.
1421-
1422-
```bash
1423-
git checkout vN.x
1424-
git reset --hard upstream/main
1425-
git checkout vN.x-staging
1426-
git reset --hard upstream/main
1427-
git push upstream vN.x
1428-
git push upstream vN.x-staging
1429-
```
1430-
1431-
### Update `NODE_MODULE_VERSION`
1432+
##### Update `NODE_MODULE_VERSION`
14321433

14331434
This macro in `src/node_version.h` is used to signal an ABI version for native
14341435
addons. It currently has two common uses in the community:
@@ -1458,24 +1459,12 @@ see a need to bump `NODE_MODULE_VERSION` outside of a major release then
14581459
you should consult the TSC. Commits may need to be reverted or a major
14591460
version bump may need to happen.
14601461

1461-
### Test releases and release candidates
1462-
1463-
Test builds should be generated from the `vN.x-proposal` branch starting at
1464-
about 6 weeks before the release.
1465-
1466-
Release Candidates should be generated from the `vN.x-proposal` branch starting
1467-
at about 4 weeks before the release, with a target of one release candidate
1468-
per week.
1469-
1470-
Always run test releases and release candidates through the Canary in the
1471-
Goldmine tool for additional testing.
1472-
1473-
### Changelogs
1462+
##### Changelogs
14741463

14751464
Generating major release changelogs is a bit more involved than minor and patch
14761465
changelogs.
14771466

1478-
#### Create the changelog file
1467+
###### Create the changelog file
14791468

14801469
In the `doc/changelogs` directory, create a new `CHANGELOG_V{N}.md` file where
14811470
`{N}` is the major version of the release. Follow the structure of the existing
@@ -1487,7 +1476,7 @@ updated to account for the new `CHANGELOG_V{N}.md` file.
14871476
Once the file is created, the root `CHANGELOG.md` file must be updated to
14881477
reference the newly-created major release `CHANGELOG_V{N}.md`.
14891478

1490-
#### Generate the changelog
1479+
###### Generate the changelog
14911480

14921481
To generate a proper major release changelog, use the `branch-diff` tool to
14931482
compare the `vN.x` branch against the `vN-1.x` branch (e.g. for Node.js 12.0,
@@ -1506,14 +1495,7 @@ $ branch-diff upstream/vN-1.x upstream/vN.x --require-label=semver-minor --group
15061495
$ branch-diff upstream/vN-1.x upstream/vN.x --exclude-label=semver-major,semver-minor --group --filter-release --markdown # get all patches
15071496
```
15081497

1509-
#### Generate the notable changes
1510-
1511-
For a major release, all SEMVER-MAJOR commits that are not strictly internal,
1512-
test, or doc-related are to be listed as notable changes. Some SEMVER-MINOR
1513-
commits may be listed as notable changes on a case-by-case basis. Use your
1514-
judgment there.
1515-
1516-
### Update the expected assets
1498+
##### Update the expected assets
15171499

15181500
The promotion script does a basic check that the expected files are present.
15191501
Open a pull request in the Build repository to add the list of expected files
@@ -1522,6 +1504,39 @@ version of the release), in the [expected assets][] folder. The change will
15221504
need to be deployed onto the web server by a member of the [build-infra team][]
15231505
before the release is promoted.
15241506

1507+
### Semver-major release (April)
1508+
1509+
#### Release proposal
1510+
1511+
A draft release proposal should be created 6 weeks before the release. A
1512+
separate `vN.x-proposal` branch should be created that tracks the `vN.x`
1513+
branch. This branch will contain the draft release commit (with the draft
1514+
changelog).
1515+
1516+
Notify the `@nodejs/npm` team in the release proposal PR to inform them of the
1517+
upcoming release.
1518+
1519+
Major release proposal should contain a single commit, the release one. All
1520+
semver-major changes must have landed in a alpha version before the major is
1521+
released. Semver-major changes that have missed the alpha period will be included
1522+
in the next major release line.
1523+
1524+
##### Marking a release line as "out of Alpha"
1525+
1526+
To mark a release line as stable, the following changes must be made to
1527+
`src/node_version.h`:
1528+
1529+
* Remove `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
1530+
`NODE_ALPHA_PATCH_VERSION`.
1531+
1532+
#### Generate the notable changes
1533+
1534+
For a major release, all SEMVER-MAJOR commits that are not strictly internal,
1535+
test, or doc-related are to be listed as notable changes. Some SEMVER-MINOR
1536+
commits may be listed as notable changes on a case-by-case basis. Use your
1537+
judgment there.
1538+
Include the notable changes from the Alpha versions where it applies.
1539+
15251540
### Snap
15261541

15271542
The Node.js [Snap][] package has a "default" for installs where the user hasn't

src/node_version.h

Lines changed: 16 additions & 6 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
@@ -41,18 +45,24 @@
4145
#endif
4246

4347
#ifndef NODE_TAG
44-
# if NODE_VERSION_IS_RELEASE
45-
# define NODE_TAG ""
46-
# else
47-
# define NODE_TAG "-pre"
48-
# endif
48+
#if NODE_VERSION_IS_RELEASE
49+
#ifdef NODE_ALPHA_MAJOR_VERSION
50+
#define NODE_TAG \
51+
"-alpha." NODE_STRINGIFY(NODE_ALPHA_MAJOR_VERSION) "." NODE_STRINGIFY( \
52+
NODE_ALPHA_MINOR_VERSION) "." NODE_STRINGIFY(NODE_ALPHA_PATCH_VERSION)
4953
#else
54+
#define NODE_TAG ""
55+
#endif // NODE_ALPHA_MAJOR_VERSION
56+
#else // NODE_VERSION_IS_RELEASE
57+
#define NODE_TAG "-pre"
58+
#endif // NODE_VERSION_IS_RELEASE
59+
#else // NODE_TAG
5060
// NODE_TAG is passed without quotes when rc.exe is run from msbuild
5161
# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
5262
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
5363
NODE_STRINGIFY(NODE_PATCH_VERSION) \
5464
NODE_STRINGIFY(NODE_TAG)
55-
#endif
65+
#endif // NODE_TAG
5666

5767
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
5868
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \

0 commit comments

Comments
 (0)