Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions doc/contributing/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ already defined in `src/node_version.h`:
#define NODE_PATCH_VERSION z

// And for alpha releases:
#define NODE_VERSION_IS_ALPHA 1
#define NODE_ALPHA_MAJOR_VERSION a
#define NODE_ALPHA_MINOR_VERSION b
#define NODE_ALPHA_PATCH_VERSION c
Expand All @@ -445,8 +446,7 @@ be produced with a version string that does not have a trailing pre-release tag:
<details>
<summary>Major version release</summary>

Remove the `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
`NODE_ALPHA_PATCH_VERSION` macros.
Set the `NODE_VERSION_IS_ALPHA` macro value to `0`.

</details>

Expand Down Expand Up @@ -989,9 +989,9 @@ edit it instead and:

* Increment `NODE_MAJOR_VERSION` by one.
* Reset `NODE_PATCH_VERSION` and `NODE_MINOR_VERSION` to `0`.
* Set `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
`NODE_ALPHA_PATCH_VERSION` back to `0` (`main` should already have this, the
release commit will have them removed).
* Set `NODE_VERSION_IS_ALPHA`, `NODE_ALPHA_MAJOR_VERSION`,
`NODE_ALPHA_MINOR_VERSION`, and `NODE_ALPHA_PATCH_VERSION` back to `0`
(`main` should already have this).
* Change `NODE_VERSION_IS_RELEASE` back to `0`.

Amend the current commit to apply the changes:
Expand Down Expand Up @@ -1532,8 +1532,7 @@ in the next major release line.
To mark a release line as stable, the following changes must be made to
`src/node_version.h`:

* Remove `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
`NODE_ALPHA_PATCH_VERSION`.
* Set `NODE_VERSION_IS_ALPHA` to `0`.

#### Generate the notable changes

Expand Down
5 changes: 3 additions & 2 deletions src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#define NODE_VERSION_IS_RELEASE 0

#define NODE_VERSION_IS_ALPHA 0
#define NODE_ALPHA_MAJOR_VERSION 0
#define NODE_ALPHA_MINOR_VERSION 0
#define NODE_ALPHA_PATCH_VERSION 0
Expand All @@ -46,13 +47,13 @@

#ifndef NODE_TAG
#if NODE_VERSION_IS_RELEASE
#ifdef NODE_ALPHA_MAJOR_VERSION
#if NODE_VERSION_IS_ALPHA
#define NODE_TAG \
"-alpha." NODE_STRINGIFY(NODE_ALPHA_MAJOR_VERSION) "." NODE_STRINGIFY( \
NODE_ALPHA_MINOR_VERSION) "." NODE_STRINGIFY(NODE_ALPHA_PATCH_VERSION)
#else
#define NODE_TAG ""
#endif // NODE_ALPHA_MAJOR_VERSION
#endif // NODE_VERSION_IS_ALPHA
#else // NODE_VERSION_IS_RELEASE
#define NODE_TAG "-pre"
#endif // NODE_VERSION_IS_RELEASE
Expand Down
9 changes: 9 additions & 0 deletions test/parallel/test-release-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ if (lts) {
assert.notStrictEqual(codename, '');
}

const alpha = getDefine(versionText, 'NODE_VERSION_IS_ALPHA') !== '0';
// The alpha tag should only be present if the alpha bit is set.
const alphaTag = alpha ?
`-alpha.${getDefine(versionText, 'NODE_ALPHA_MAJOR_VERSION')}` +
`.${getDefine(versionText, 'NODE_ALPHA_MINOR_VERSION')}` +
`.${getDefine(versionText, 'NODE_ALPHA_PATCH_VERSION')}` :
'';
assert.strictEqual(process.version, `v${major}.${minor}.${patch}${alphaTag}`);

const changelogPath = `doc/changelogs/CHANGELOG_V${major}.md`;
// Check CHANGELOG_V*.md
{
Expand Down
Loading