Skip to content

Commit 16f4763

Browse files
committed
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).
1 parent d09458f commit 16f4763

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/major-release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Major Release
2+
3+
permissions:
4+
issues: write
5+
contents: write
6+
7+
on:
8+
schedule:
9+
- cron: '0 0 15 * *'
10+
11+
jobs:
12+
create-issue:
13+
runs-on: ubuntu-latest
14+
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+
release_date=$(date -d "$(date +%Y-%m-%d) +2 month" +"%d %B %Y")
26+
echo "RELEASE_DATE=$release_date" >> $GITHUB_ENV
27+
pr_max_date=$(date -d "$(date +%Y-%m-%d) +1 month" +"%d %B %Y")
28+
echo "PR_MAX_DATE=$pr_max_date" >> $GITHUB_ENV
29+
else
30+
echo "create_issue=false" >> $GITHUB_ENV
31+
fi
32+
- name: Create release announcement issue
33+
if: env.create_issue == 'true'
34+
run: |
35+
cat <<EOF > body.json
36+
{
37+
"title": "Upcoming Node.js Major Release",
38+
"body": "A reminder that the next Node.js **semver major release** is scheduled for **${RELEASE_DATE}**.\n
39+
Therefore, all commits that were landed until **${PR_MAX_DATE}** (one month prior to the release) will be included in the next semver major release.\n
40+
41+
Please ensure that any necessary preparations are made in advance.\n
42+
For more details on the release process, visit the [Node.js Release Working Group](https://github.com/nodejs/release).\n
43+
44+
cc: @nodejs/collaborators"
45+
}
46+
EOF
47+
curl --request POST \
48+
--url https://api.github.com/repos/${GITHUB_REPOSITORY}/issues \
49+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
50+
--header 'content-type: application/json' \
51+
--data @body.json

0 commit comments

Comments
 (0)