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

2024-11-29, Version 23.3.1 (Current), @RafaelGSS #10

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
81 changes: 81 additions & 0 deletions .github/workflows/create-release-proposal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# This action requires the following secrets to be set on the repository:
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
# JENKINS_TOKEN: Jenkins token, to be used to check CI status

name: Create Release Proposal

on:
workflow_dispatch:
inputs:
release-line:
required: true
type: number
default: 23
description: 'The release line (without dots or prefix). e.g: 22'
release-date:
required: true
type: string
default: YYYY-MM-DD
description: The release date in YYYY-MM-DD format

concurrency: ${{ github.workflow }}

env:
NODE_VERSION: lts/*

permissions:
contents: 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ env.STAGING_BRANCH }}
# Needs the whole git history for ncu to work
# See https://github.com/nodejs/node-core-utils/pull/486
fetch-depth: 0

# Install dependencies
- name: Install Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
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 "$USERNAME"
ncu-config set token "$GH_TOKEN"
ncu-config set jenkins_token "$JENKINS_TOKEN"
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
env:
USERNAME: ${{ secrets.JENKINS_USER }}
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}

- name: Set up ghauth config (Ubuntu)
run: |
mkdir -p ~/.config/changelog-maker/
echo '{
"user": "'$(ncu-config get username)'",
"token": "'$(ncu-config get token)'"
}' > ~/.config/changelog-maker/config.json

- name: Start git node release prepare
run: |
./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}"
env:
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ release.
<th title="LTS Until 2025-04"><a href="doc/changelogs/CHANGELOG_V18.md">18</a> (LTS)</th>
</tr>
<tr>
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.3.0">23.3.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.3.1">23.3.1</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V23.md#23.3.0">23.3.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V23.md#23.2.0">23.2.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V23.md#23.1.0">23.1.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V23.md#23.0.0">23.0.0</a><br/>
Expand Down
12 changes: 12 additions & 0 deletions doc/changelogs/CHANGELOG_V23.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</tr>
<tr>
<td>
<a href="#23.3.1">23.3.1</a><br/>
<a href="#23.3.0">23.3.0</a><br/>
<a href="#23.2.0">23.2.0</a><br/>
<a href="#23.1.0">23.1.0</a><br/>
Expand Down Expand Up @@ -41,6 +42,17 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)

<a id="23.3.1"></a>

## 2024-11-29, Version 23.3.1 (Current), @RafaelGSS

### Notable Changes

### Commits

* \[[`dfd77b442f`](https://github.com/nodejs/node/commit/dfd77b442f)] - fixup! build: add create release proposal action (RafaelGSS)
* \[[`02b5d989ff`](https://github.com/nodejs/node/commit/02b5d989ff)] - **build**: add create release proposal action (RafaelGSS)

<a id="23.3.0"></a>

## 2024-11-20, Version 23.3.0 (Current), @RafaelGSS
Expand Down
2 changes: 1 addition & 1 deletion src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define NODE_VERSION_IS_LTS 0
#define NODE_VERSION_LTS_CODENAME ""

#define NODE_VERSION_IS_RELEASE 0
#define NODE_VERSION_IS_RELEASE 1

#ifndef NODE_STRINGIFY
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
Expand Down
44 changes: 44 additions & 0 deletions tools/actions/create-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

set -xe

RELEASE_DATE=$1
RELEASE_LINE=$2

if [ -z "$RELEASE_DATE" ] || [ -z "$RELEASE_LINE" ]; then
echo "Usage: $0 <RELEASE_DATE> <RELEASE_LINE>"
exit 1
fi

git config --local user.email "[email protected]"
git config --local user.name "Node.js GitHub Bot"

git node release --prepare --skipBranchDiff --yes --releaseDate "$RELEASE_DATE"
# We use it to not specify the branch name as it changes based on
# the commit list (semver-minor/semver-patch)
git config push.default current
git push

TITLE=$(awk "/^## ${RELEASE_DATE}/ { print substr(\$0, 4) }" "doc/changelogs/CHANGELOG_V${RELEASE_LINE}.md")

# Use a temporary file for the PR body
TEMP_BODY=$(mktemp)
awk "/## ${RELEASE_DATE}/,/^<a id=/{ if (!/^<a id=/) print }" "doc/changelogs/CHANGELOG_V${RELEASE_LINE}.md" > "$TEMP_BODY"

gh pr create --title "$TITLE" --body-file "$TEMP_BODY" --base "v$RELEASE_LINE.x"

# Dynamically get the repository (owner/repo) and branch
REPO=$(git remote get-url origin | sed -E 's|^.*github.com[/:]([^/]+/[^.]+)(\.git)?$|\1|')
BRANCH=$(git branch --show-current)

# Get the PR URL for the current branch in the repository
PR_URL=$(gh pr list --repo "$REPO" --head "$BRANCH" --json url -q ".[0].url")

# Replace "TODO" with the PR URL in the last commit
git commit --amend --no-edit -m "$(git log -1 --pretty=%B | sed "s|PR-URL: TODO|PR-URL: $PR_URL|")"

# Force-push the amended commit
git push --force

rm "$TEMP_BODY"