Skip to content

Commit db9a3b2

Browse files
RafaelGSSruyadorno
authored andcommitted
build: add major release action
This action reminds collaborators of the upcoming major release date. In the future, this action can also update and create the branches (that's why the action name is generic). PR-URL: #56199 Refs: #55732 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent fbc2830 commit db9a3b2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/major-release.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Major Release
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 15 2,8 * # runs at midnight UTC every 15 February and 15 August
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
create-issue:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
steps:
16+
- name: Check for release schedule
17+
id: check-date
18+
run: |
19+
# Get the current month and day
20+
MONTH=$(date +'%m')
21+
DAY=$(date +'%d')
22+
# We'll create the reminder issue two months prior the release
23+
if [[ "$MONTH" == "02" || "$MONTH" == "08" ]] && [[ "$DAY" == "15" ]]; then
24+
echo "create_issue=true" >> "$GITHUB_ENV"
25+
fi
26+
- name: Retrieve next major release info from nodejs/Release
27+
if: env.create_issue == 'true'
28+
run: |
29+
curl -L https://github.com/nodejs/Release/raw/HEAD/schedule.json | \
30+
jq -r 'to_entries | map(select(.value.start | strptime("%Y-%m-%d") | mktime > now)) | first | "VERSION=" + .key + "\nRELEASE_DATE=" + .value.start' >> "$GITHUB_ENV"
31+
- name: Compute max date for landing semver-major PRs
32+
if: env.create_issue == 'true'
33+
run: |
34+
echo "PR_MAX_DATE=$(date -d "$RELEASE_DATE -1 month" +%Y-%m-%d)" >> "$GITHUB_ENV"
35+
- name: Create release announcement issue
36+
if: env.create_issue == 'true'
37+
run: |
38+
gh issue create --repo "${GITHUB_REPOSITORY}" \
39+
--title "Upcoming Node.js Major Release ($VERSION)" \
40+
--body-file -<<EOF
41+
A reminder that the next Node.js **SemVer Major release** is scheduled for **${RELEASE_DATE}**.
42+
All commits that were landed until **${PR_MAX_DATE}** (one month prior to the release) will be included in the next semver major release. Please ensure that any necessary preparations are made in advance.
43+
For more details on the release process, consult the [Node.js Release Working Group repository](https://github.com/nodejs/release).
44+
45+
cc: @nodejs/collaborators
46+
EOF
47+
env:
48+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)