Skip to content

Check for new V8 version #366

Check for new V8 version

Check for new V8 version #366

name: Check for new V8 version
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
jobs:
get-v8-version:
uses: ./.github/workflows/GET_V8_VERSION.yml
check-for-new-V8-version:
needs: [get-v8-version]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install depot_tools
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- name: Checkout v8 and set the version on env var
id: get-latest-version
run: |
export v1=`echo ${{ needs.get-v8-version.outputs.V8_VERSION }} | cut -d'.' -f1`
export v2=`echo ${{ needs.get-v8-version.outputs.V8_VERSION }} | cut -d'.' -f2`
export version=$v1.$v2
export PATH="${PATH}:$(pwd)/depot_tools/"
gclient
mkdir v8
cd v8
fetch v8
cd v8
git checkout branch-heads/$version
export latest_version=`git describe --tags --exact-match`
echo "latest_version=$latest_version" >> "$GITHUB_OUTPUT"
- name: Check if PR was already created
id: is-branch-exists
env:
branch_name: auto_update_version_to_${{ steps.get-latest-version.outputs.latest_version }}
run: |
git fetch
export branch_exists=`git show-branch origin/${{ env.branch_name }} &>/dev/null && echo yes || echo no`
echo "branch_exists=$branch_exists" >> "$GITHUB_OUTPUT"
echo "branch_name=${{ env.branch_name }}" >> "$GITHUB_OUTPUT"
- name: Create PR if needed
env:
latest_version: ${{ steps.get-latest-version.outputs.latest_version }}
branch_exists: ${{ steps.is-branch-exists.outputs.branch_exists }}
branch_name: ${{ steps.is-branch-exists.outputs.branch_name }}
GH_TOKEN: ${{ github.token }}
if: ${{ needs.get-v8-version.outputs.V8_VERSION < env.latest_version && env.branch_exists == 'no'}}
run: |
sed -i 's/${{ needs.get-v8-version.outputs.V8_VERSION }}/${{ env.latest_version }}/g' ./V8_VERSION.txt
git config --global user.email "auto@redis.com"
git config --global user.name "auto user"
git checkout -b ${{ env.branch_name }}
git add ./V8_VERSION.txt
git commit -m "Update version to ${{ env.latest_version }}"
git push origin ${{ env.branch_name }}
gh pr create --title "Update version to ${{ env.latest_version }}" --body "Generated by GitHub nightly" --reviewer MeirShpilraien,iddm