-
Notifications
You must be signed in to change notification settings - Fork 30.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nodejs:main' into main
- Loading branch information
Showing
2,282 changed files
with
157,722 additions
and
109,568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# This action requires the following secrets to be set on the repository: | ||
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes | ||
|
||
name: Create Release Proposal | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-line: | ||
required: true | ||
type: number | ||
description: 'The release line (without dots or prefix). e.g: 22' | ||
release-date: | ||
required: true | ||
type: string | ||
description: The release date in YYYY-MM-DD format | ||
|
||
concurrency: ${{ github.workflow }} | ||
|
||
env: | ||
NODE_VERSION: lts/* | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
releasePrepare: | ||
env: | ||
STAGING_BRANCH: v${{ inputs.release-line }}.x-staging | ||
RELEASE_BRANCH: v${{ inputs.release-line }}.x | ||
RELEASE_DATE: ${{ inputs.release-date }} | ||
RELEASE_LINE: ${{ inputs.release-line }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
ref: ${{ env.STAGING_BRANCH }} | ||
persist-credentials: false | ||
|
||
# Install dependencies | ||
- name: Install Node.js | ||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install @node-core/utils | ||
run: npm install -g @node-core/utils | ||
|
||
- name: Configure @node-core/utils | ||
run: | | ||
ncu-config set branch "${RELEASE_BRANCH}" | ||
ncu-config set upstream origin | ||
ncu-config set username "$GITHUB_ACTOR" | ||
ncu-config set token "$GH_TOKEN" | ||
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)" | ||
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: Set up ghauth config (Ubuntu) | ||
run: | | ||
mkdir -p "${XDG_CONFIG_HOME:-~/.config}/changelog-maker" | ||
echo '{}' | jq '{user: env.GITHUB_ACTOR, token: env.TOKEN}' > "${XDG_CONFIG_HOME:-~/.config}/changelog-maker/config.json" | ||
env: | ||
TOKEN: ${{ github.token }} | ||
|
||
- name: Setup git author | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Node.js GitHub Bot" | ||
- name: Start git node release prepare | ||
# The curl command is to make sure we run the version of the script corresponding to the current workflow. | ||
run: | | ||
git update-index --assume-unchanged tools/actions/create-release.sh | ||
curl -fsSLo tools/actions/create-release.sh https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/create-release.sh | ||
./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}" "${GITHUB_ACTOR}" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
# We want the bot to push the push the release commit so CI runs on it. | ||
BOT_TOKEN: ${{ secrets.GH_USER_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Linters (release proposals) | ||
|
||
on: | ||
push: | ||
branches: | ||
- v[0-9]+.[0-9]+.[0-9]+-proposal | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHON_VERSION: '3.12' | ||
NODE_VERSION: lts/* | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint-release-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
persist-credentials: false | ||
- name: Lint release commit title format | ||
run: | | ||
EXPECTED_TITLE='^[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}, Version [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ (\(Current|'.+' \(LTS)\)$' | ||
echo "Expected commit title format: $EXPECTED_TITLE" | ||
COMMIT_SUBJECT="$(git --no-pager log -1 --format=%s)" | ||
echo "Actual: $ACTUAL" | ||
echo "$COMMIT_SUBJECT" | grep -q -E "$EXPECTED_TITLE" | ||
echo "COMMIT_SUBJECT=$COMMIT_SUBJECT" >> "$GITHUB_ENV" | ||
- name: Lint release commit message trailers | ||
run: | | ||
EXPECTED_TRAILER="^PR-URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/[[:digit:]]+\$" | ||
echo "Expected trailer format: $EXPECTED_TRAILER" | ||
ACTUAL="$(git --no-pager log -1 --format=%b | git interpret-trailers --parse --no-divider)" | ||
echo "Actual: $ACTUAL" | ||
echo "$ACTUAL" | grep -E -q "$EXPECTED_TRAILER" | ||
PR_URL="${ACTUAL:8}" | ||
PR_HEAD="$(gh pr view "$PR_URL" --json headRefOid -q .headRefOid)" | ||
echo "Head of $PR_URL: $PR_HEAD" | ||
echo "Current commit: $GITHUB_SHA" | ||
[ "$PR_HEAD" = "$GITHUB_SHA" ] | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Validate CHANGELOG | ||
id: releaser-info | ||
run: | | ||
EXPECTED_CHANGELOG_TITLE_INTRO="## $COMMIT_SUBJECT, @" | ||
echo "Expected CHANGELOG section title: $EXPECTED_CHANGELOG_TITLE_INTRO" | ||
CHANGELOG_TITLE="$(grep "$EXPECTED_CHANGELOG_TITLE_INTRO" "doc/changelogs/CHANGELOG_V${COMMIT_SUBJECT:20:2}.md")" | ||
echo "Actual: $CHANGELOG_TITLE" | ||
[ "${CHANGELOG_TITLE%%@*}@" = "$EXPECTED_CHANGELOG_TITLE_INTRO" ] | ||
- name: Verify NODE_VERSION_IS_RELEASE bit is correctly set | ||
run: | | ||
grep -q '^#define NODE_VERSION_IS_RELEASE 1$' src/node_version.h | ||
- name: Check for placeholders in documentation | ||
run: | | ||
! grep "REPLACEME" doc/api/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Major Release | ||
|
||
on: | ||
schedule: | ||
- cron: 0 0 15 2,8 * # runs at midnight UTC every 15 February and 15 August | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
create-issue: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
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" | ||
fi | ||
- name: Retrieve next major release info from nodejs/Release | ||
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: Compute max date for landing semver-major PRs | ||
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}**. | ||
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, consult the [Node.js Release Working Group repository](https://github.com/nodejs/release). | ||
cc: @nodejs/collaborators | ||
EOF | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.