-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
tools: automate v8 patch update #47594
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
Merged
nodejs-github-bot
merged 7 commits into
nodejs:main
from
marco-ippolito:feat/automate-v8-update
Apr 26, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0a46fe1
tools: automate v8 patch update
marco-ippolito 827f23f
fix: move v8 update in tools.yml
marco-ippolito cf9270a
fix: cache only with v8
marco-ippolito 936482c
fix: reverted to update-v8.yml
marco-ippolito 9e5b634
fix: remove commit step
marco-ippolito 8bba38f
fix: remove commit message
marco-ippolito 5f2a7ad
fix: remove commit from script
marco-ippolito File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,51 @@ | ||
name: V8 patch update | ||
on: | ||
schedule: | ||
# Run once a week at 00:05 AM UTC on Sunday. | ||
- cron: 5 0 * * 0 | ||
workflow_dispatch: | ||
|
||
env: | ||
NODE_VERSION: lts/* | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
v8-update: | ||
if: github.repository == 'nodejs/node' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | ||
with: | ||
path: | | ||
~/.update-v8 | ||
~/.npm | ||
# Install dependencies | ||
- name: Install Node.js | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Install node-core-utils | ||
run: npm install -g node-core-utils@latest | ||
- name: Check and download new V8 version | ||
run: | | ||
./tools/dep_updaters/update-v8-patch.sh > temp-output | ||
cat temp-output | ||
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | ||
rm temp-output | ||
- uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5 | ||
# Creates a PR or update the Action's existing PR, or | ||
# no-op if the base branch is already up-to-date. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
with: | ||
author: Node.js GitHub Bot <[email protected]> | ||
body: This is an automated patch update of V8 to ${{ env.NEW_VERSION }}. | ||
branch: actions/update-v8-patch # Custom branch *just* for this Action. | ||
labels: v8 engine | ||
title: 'deps: patch V8 to ${{ env.NEW_VERSION }}' | ||
update-pull-request-title-and-body: true |
This file contains hidden or 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,30 @@ | ||
#!/bin/sh | ||
set -e | ||
# Shell script to update v8 patch update | ||
|
||
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) | ||
|
||
cd "$BASE_DIR" | ||
|
||
IS_UP_TO_DATE=$(git node v8 minor | grep "V8 is up-to-date") | ||
|
||
if [ -n "$IS_UP_TO_DATE" ]; then | ||
echo "Skipped because V8 is on the latest version." | ||
exit 0 | ||
fi | ||
|
||
DEPS_DIR="$BASE_DIR/deps" | ||
|
||
CURRENT_MAJOR_VERSION=$(grep "#define V8_MAJOR_VERSION" "$DEPS_DIR/v8/include/v8-version.h" | cut -d ' ' -f3) | ||
CURRENT_MINOR_VERSION=$(grep "#define V8_MINOR_VERSION" "$DEPS_DIR/v8/include/v8-version.h" | cut -d ' ' -f3) | ||
CURRENT_BUILD_VERSION=$(grep "#define V8_BUILD_NUMBER" "$DEPS_DIR/v8/include/v8-version.h" | cut -d ' ' -f3) | ||
CURRENT_PATCH_VERSION=$(grep "#define V8_PATCH_LEVEL" "$DEPS_DIR/v8/include/v8-version.h" | cut -d ' ' -f3) | ||
|
||
NEW_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_BUILD_VERSION.$CURRENT_PATCH_VERSION" | ||
|
||
echo "All done!" | ||
echo "" | ||
|
||
# The last line of the script should always print the new version, | ||
# as we need to add it to $GITHUB_ENV variable. | ||
echo "NEW_VERSION=$NEW_VERSION" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.