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

tools: automate v8 patch update #47594

Merged
merged 7 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 11 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,22 @@ jobs:
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- id: v8
subsystem: deps
label: dependencies
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
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id
with:
persist-credentials: false
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
marco-ippolito marked this conversation as resolved.
Show resolved Hide resolved
path: ~/.update-v8/v8
- run: ${{ matrix.run }}
if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id
env:
Expand Down
35 changes: 35 additions & 0 deletions tools/dep_updaters/update-v8-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/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")
targos marked this conversation as resolved.
Show resolved Hide resolved

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 ""
echo "Please git add v8, commit the new version:"
echo ""
echo "$ git add -A deps/v8"
echo "$ git commit -m \"deps: update v8 to $NEW_VERSION\""
marco-ippolito marked this conversation as resolved.
Show resolved Hide resolved
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"