Skip to content

Commit c853745

Browse files
committed
workflows: add nsolid release automation
1 parent 4120f3e commit c853745

6 files changed

Lines changed: 578 additions & 0 deletions

File tree

.github/nsolid-release-lines.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"nodeReleaseLines": [22, 24]
3+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Create N|Solid Release Proposal
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
node-line:
7+
required: true
8+
type: choice
9+
options:
10+
- '22'
11+
- '24'
12+
description: Node.js release line
13+
14+
concurrency: ${{ github.workflow }}-${{ inputs.node-line }}
15+
16+
permissions:
17+
contents: write
18+
issues: write
19+
pull-requests: write
20+
21+
jobs:
22+
create:
23+
if: github.repository == 'nodesource/nsolid'
24+
runs-on: ubuntu-slim
25+
steps:
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
with:
28+
fetch-depth: 0
29+
persist-credentials: true
30+
token: ${{ secrets.GH_USER_TOKEN || github.token }}
31+
32+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
33+
with:
34+
node-version: lts/*
35+
36+
- name: Create release proposal
37+
run: tools/actions/create-nsolid-release-proposal.sh
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN || github.token }}
40+
GH_TOKEN: ${{ secrets.GH_USER_TOKEN || github.token }}
41+
NODE_LINE: ${{ inputs.node-line }}
42+
43+
- name: Upload conflict report
44+
if: failure() && hashFiles('nsolid-release-conflicts.md') != ''
45+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
46+
with:
47+
name: nsolid-release-conflicts
48+
path: nsolid-release-conflicts.md
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Watch Node.js Releases
2+
3+
on:
4+
schedule:
5+
- cron: '17 12 * * *'
6+
workflow_dispatch:
7+
8+
concurrency: ${{ github.workflow }}
9+
10+
permissions:
11+
contents: write
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
watch:
17+
if: github.repository == 'nodesource/nsolid'
18+
runs-on: ubuntu-slim
19+
steps:
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
22+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
23+
with:
24+
node-version: lts/*
25+
26+
- name: Watch Node.js release lines
27+
run: node tools/actions/watch-node-releases.mjs
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN || github.token }}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# N|Solid release automation
2+
3+
This document describes the GitHub Actions automation that tracks Node.js
4+
releases and prepares N|Solid release proposal pull requests.
5+
6+
The automation is intentionally small. A releaser should be able to run it from
7+
the GitHub Actions UI by selecting only the Node.js release line.
8+
9+
## What it does
10+
11+
The automation has two workflows:
12+
13+
* `Watch Node.js Releases`
14+
* runs on a schedule and can also be started manually;
15+
* reads `.github/nsolid-release-lines.json`;
16+
* checks the latest stable Node.js release for each configured line;
17+
* skips the release if an N|Solid release branch or tag already exists;
18+
* creates or reuses a tracking issue;
19+
* attempts to create the release proposal.
20+
* `Create N|Solid Release Proposal`
21+
* is manually started with one input: `node-line`;
22+
* finds the latest stable Node.js tag for that line;
23+
* checks out `node-v<line>.x-nsolid-v6.x`;
24+
* reads the current N|Solid version from `src/node_version.h`;
25+
* creates `node-vX.Y.Z-nsolid-vA.B.C-release`;
26+
* merges the upstream Node.js tag;
27+
* sets `NSOLID_VERSION_IS_RELEASE` to `1`;
28+
* prepends the N|Solid changelog entry;
29+
* pushes the release branch;
30+
* opens a draft release PR.
31+
32+
If the Node.js tag merge conflicts, the workflow stops, comments on the
33+
tracking issue when one exists, and uploads `nsolid-release-conflicts.md` as an
34+
artifact.
35+
36+
The automation does not create a release tag. Release tags should still be
37+
created by the releaser after the proposal is reviewed.
38+
39+
## Supported release lines
40+
41+
The supported lines are configured in `.github/nsolid-release-lines.json`:
42+
43+
```json
44+
{
45+
"nodeReleaseLines": [22, 24]
46+
}
47+
```
48+
49+
Only lines listed there are watched by the scheduled workflow and shown in the
50+
manual workflow selector.
51+
52+
## Add a release line
53+
54+
When N|Solid starts supporting a new Node.js release line:
55+
56+
1. Add the major version to `.github/nsolid-release-lines.json`.
57+
2. Add the same value to the `node-line` options in
58+
`.github/workflows/create-nsolid-release-proposal.yml`.
59+
3. Ensure the base branch exists:
60+
`node-v<line>.x-nsolid-v6.x`.
61+
4. Ensure the N|Solid changelog exists:
62+
`doc/changelogs/NSOLID_CHANGELOG_V6_NODE_V<line>.md`.
63+
5. Run the workflow manually once for that line.
64+
65+
For example, to add Node.js v26 support, add `26` to the JSON file and add
66+
`'26'` to the workflow options.
67+
68+
## Remove a release line
69+
70+
When N|Solid stops supporting a Node.js release line:
71+
72+
1. Remove the major version from `.github/nsolid-release-lines.json`.
73+
2. Remove the same value from the `node-line` options in
74+
`.github/workflows/create-nsolid-release-proposal.yml`.
75+
76+
Do not delete existing release branches, tags, or changelog files as part of
77+
removing the line from automation.
78+
79+
## Manual use
80+
81+
To prepare a release proposal manually:
82+
83+
1. Open the `Create N|Solid Release Proposal` workflow.
84+
2. Select the Node.js release line.
85+
3. Run the workflow.
86+
87+
The workflow always uses the latest stable Node.js release for the selected
88+
line. If a different upstream tag is required, prepare the release manually.
89+
90+
## Failure handling
91+
92+
If the release branch already exists and has an open PR, the workflow reuses the
93+
existing PR. If the release branch exists without an open PR, the workflow fails
94+
so a releaser can inspect the branch before opening a PR manually.
95+
96+
If the workflow fails with merge conflicts:
97+
98+
1. Open the workflow artifact named `nsolid-release-conflicts`.
99+
2. Resolve the listed conflicts locally from the generated release branch steps.
100+
3. Continue the release manually.
101+
102+
If the workflow fails while creating the PR, the release branch may already have
103+
been pushed. Open the PR manually using the branch named in the workflow logs.

0 commit comments

Comments
 (0)