Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add major release action #56199

Merged
Merged
Changes from 3 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
49 changes: 49 additions & 0 deletions .github/workflows/major-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Major Release

permissions:
issues: write
contents: write
RafaelGSS marked this conversation as resolved.
Show resolved Hide resolved

on:
schedule:
- cron: 0 0 15 2,8 * # runs at midnight UTC every 15 February and 15 August

jobs:
create-issue:
runs-on: ubuntu-latest

steps:
- name: Check for release schedule
id: check-date
run: |
# Get the current month and day
MONTH=$(date +'%m')
DAY=$(date +'%d')
# We'll create the reminder issue two months prior the release
if [[ "$MONTH" == "02" || "$MONTH" == "08" ]] && [[ "$DAY" == "15" ]]; then
echo "create_issue=true" >> $GITHUB_ENV
RafaelGSS marked this conversation as resolved.
Show resolved Hide resolved
fi
- name: Calculate release date and version
RafaelGSS marked this conversation as resolved.
Show resolved Hide resolved
if: env.create_issue == 'true'
run: |
curl -L https://github.com/nodejs/Release/raw/HEAD/schedule.json | \
jq -r 'to_entries | map(select(.value.start | strptime("%Y-%m-%d") | mktime > now)) | first | "VERSION=" + .key + "\nRELEASE_DATE=" + .value.start' >> "$GITHUB_ENV"
- name: Calculate max date for PR
RafaelGSS marked this conversation as resolved.
Show resolved Hide resolved
if: env.create_issue == 'true'
run: |
echo "PR_MAX_DATE=$(date -d "$RELEASE_DATE -1 month" +%Y-%m-%d)" >> "$GITHUB_ENV"
- name: Create release announcement issue
if: env.create_issue == 'true'
run: |
gh issue create --repo "${GITHUB_REPOSITORY}" \
--title "Upcoming Node.js Major Release ($VERSION)" \
--body-file -<<EOF
A reminder that the next Node.js **semver major release** is scheduled for **${RELEASE_DATE}**.
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.
Please ensure that any necessary preparations are made in advance.
For more details on the release process, visit the [Node.js Release Working Group](https://github.com/nodejs/release).
RafaelGSS marked this conversation as resolved.
Show resolved Hide resolved

cc: @nodejs/collaborators
RafaelGSS marked this conversation as resolved.
Show resolved Hide resolved
EOF
env:
GH_TOKEN: ${{ github.token }}
Loading