Skip to content

Commit

Permalink
Added v8 version upgrade flow
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirShpilraien committed Oct 22, 2023
1 parent 6c2b489 commit cefefe7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/update_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update Version

on:
workflow_dispatch:
inputs:
v8_version:
description: 'The version to update to'
type: string
required: true

jobs:

update-v8-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Getting V8 version
id: get-current-v8-version
run: |
export V8_VERSION_CURRENT=`cat ./V8_DEFAULT_VERSION.txt`
echo "V8_VERSION_CURRENT=$V8_VERSION_CURRENT" >> "$GITHUB_OUTPUT"
- name: Check new version is geater than current version
env:
V8_VERSION_CURRENT: ${{ steps.get-current-v8-version.outputs.V8_VERSION_CURRENT }}
if: ${{ env.V8_VERSION_CURRENT >= inputs.v8_version }}
run: |
echo new version ${{ inputs.v8_version }} is not greater then current version ${{ env.V8_VERSION_CURRENT }}
exit 1
- name: Update Version
run: echo ${{ inputs.v8_version }} > ./V8_DEFAULT_VERSION.txt
- name: Build
run: V8_UPDATE_HEADERS=${{ inputs.v8_update_headers }} cargo build -vv
- name: Run tests
run: V8_UPDATE_HEADERS=${{ inputs.v8_update_headers }} cargo test -vv
- name: Create PR if needed
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "auto user"
git checkout -b auto_update_version_to_${{ inputs.v8_version }}
git add ./V8_DEFAULT_VERSION.txt
git add ./v8_c_api/src/v8include/*
git commit -m "Auto update version to ${{ inputs.v8_version }}"
git push origin auto_update_version_to_${{ inputs.v8_version }}
gh pr create --title "Auto update version to ${{ inputs.v8_version }}" --body "Generated by GitHub action" --reviewer MeirShpilraien,vityafx
1 change: 1 addition & 0 deletions V8_DEFAULT_VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11.8.172.16
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ lazy_static::lazy_static! {

static ref PROFILE: String = env::var("PROFILE").expect("PROFILE env var was not given");

static ref V8_DEFAULT_VERSION: &'static str = "11.8.172.16";
static ref V8_DEFAULT_VERSION: &'static str = include_str!("V8_DEFAULT_VERSION.txt").trim();
static ref V8_VERSION: String = env::var("V8_VERSION").map(|v| if v == "default" {V8_DEFAULT_VERSION.to_string()} else {v}).unwrap_or(V8_DEFAULT_VERSION.to_string());
static ref V8_HEADERS_PATH: String = env::var("V8_HEADERS_PATH").unwrap_or("v8_c_api/libv8.include.zip".into());
static ref V8_HEADERS_URL: String = env::var("V8_HEADERS_URL").unwrap_or(format!("http://redismodules.s3.amazonaws.com/redisgears/dependencies/libv8.{}.include.zip", *V8_VERSION));
Expand Down

0 comments on commit cefefe7

Please sign in to comment.