Skip to content

Commit ccce945

Browse files
committed
src,doc: gate alpha version tag behind a macro
Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
1 parent 30542c3 commit ccce945

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

doc/contributing/releases.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ already defined in `src/node_version.h`:
430430
#define NODE_PATCH_VERSION z
431431

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

448-
Remove the `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
449-
`NODE_ALPHA_PATCH_VERSION` macros.
449+
Set the `NODE_VERSION_IS_ALPHA` macro value to `0`.
450450

451451
</details>
452452

@@ -989,9 +989,9 @@ edit it instead and:
989989

990990
* Increment `NODE_MAJOR_VERSION` by one.
991991
* Reset `NODE_PATCH_VERSION` and `NODE_MINOR_VERSION` to `0`.
992-
* Set `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
993-
`NODE_ALPHA_PATCH_VERSION` back to `0` (`main` should already have this, the
994-
release commit will have them removed).
992+
* Set `NODE_VERSION_IS_ALPHA`, `NODE_ALPHA_MAJOR_VERSION`,
993+
`NODE_ALPHA_MINOR_VERSION`, and `NODE_ALPHA_PATCH_VERSION` back to `0`
994+
(`main` should already have this).
995995
* Change `NODE_VERSION_IS_RELEASE` back to `0`.
996996

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

1535-
* Remove `NODE_ALPHA_MAJOR_VERSION`, `NODE_ALPHA_MINOR_VERSION`, and
1536-
`NODE_ALPHA_PATCH_VERSION`.
1535+
* Set `NODE_VERSION_IS_ALPHA` to `0`.
15371536

15381537
#### Generate the notable changes
15391538

src/node_version.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#define NODE_VERSION_IS_RELEASE 0
3333

34+
#define NODE_VERSION_IS_ALPHA 0
3435
#define NODE_ALPHA_MAJOR_VERSION 0
3536
#define NODE_ALPHA_MINOR_VERSION 0
3637
#define NODE_ALPHA_PATCH_VERSION 0
@@ -46,13 +47,13 @@
4647

4748
#ifndef NODE_TAG
4849
#if NODE_VERSION_IS_RELEASE
49-
#ifdef NODE_ALPHA_MAJOR_VERSION
50+
#if NODE_VERSION_IS_ALPHA
5051
#define NODE_TAG \
5152
"-alpha." NODE_STRINGIFY(NODE_ALPHA_MAJOR_VERSION) "." NODE_STRINGIFY( \
5253
NODE_ALPHA_MINOR_VERSION) "." NODE_STRINGIFY(NODE_ALPHA_PATCH_VERSION)
5354
#else
5455
#define NODE_TAG ""
55-
#endif // NODE_ALPHA_MAJOR_VERSION
56+
#endif // NODE_VERSION_IS_ALPHA
5657
#else // NODE_VERSION_IS_RELEASE
5758
#define NODE_TAG "-pre"
5859
#endif // NODE_VERSION_IS_RELEASE

0 commit comments

Comments
 (0)