Android V8 Build #33
Workflow file for this run
This file contains 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
name: Android V8 Build | |
concurrency: | |
group: android_v8_build_${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
env: | |
JAVET_V8_VERSION: 13.2.152.16 | |
JAVET_VERSION: 4.1.1 | |
ROOT: /home/runner/work/Javet | |
jobs: | |
build_javet_lib: | |
strategy: | |
matrix: | |
include: | |
- v8_release: arm | |
v8_arch: arm | |
android_arch: arm | |
android_abi: armeabi-v7a | |
i18n_name: i18n | |
cmake_flag: -DENABLE_I18N=1 | |
v8_flag: v8_enable_i18n_support=true | |
- v8_release: arm64 | |
v8_arch: arm64 | |
android_arch: arm64 | |
android_abi: arm64-v8a | |
i18n_name: i18n | |
cmake_flag: -DENABLE_I18N=1 | |
v8_flag: v8_enable_i18n_support=true | |
- v8_release: ia32 | |
v8_arch: x86 | |
android_arch: x86 | |
android_abi: x86 | |
i18n_name: i18n | |
cmake_flag: -DENABLE_I18N=1 | |
v8_flag: v8_enable_i18n_support=true | |
- v8_release: x64 | |
v8_arch: x64 | |
android_arch: x86_64 | |
android_abi: x86_64 | |
i18n_name: i18n | |
cmake_flag: -DENABLE_I18N=1 | |
v8_flag: v8_enable_i18n_support=true | |
- v8_release: arm | |
v8_arch: arm | |
android_arch: arm | |
android_abi: armeabi-v7a | |
i18n_name: non-i18n | |
cmake_flag: | |
v8_flag: v8_enable_i18n_support=false | |
- v8_release: arm64 | |
v8_arch: arm64 | |
android_arch: arm64 | |
android_abi: arm64-v8a | |
i18n_name: non-i18n | |
cmake_flag: | |
v8_flag: v8_enable_i18n_support=false | |
- v8_release: ia32 | |
v8_arch: x86 | |
android_arch: x86 | |
android_abi: x86 | |
i18n_name: non-i18n | |
cmake_flag: | |
v8_flag: v8_enable_i18n_support=false | |
- v8_release: x64 | |
v8_arch: x64 | |
android_arch: x86_64 | |
android_abi: x86_64 | |
i18n_name: non-i18n | |
cmake_flag: | |
v8_flag: v8_enable_i18n_support=false | |
name: Build Javet ${{ matrix.android_arch }} ${{ matrix.i18n_name }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Setup Ubuntu | |
run: | | |
sudo apt-get install -y execstack gcc-multilib | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Setup Android NDK | |
id: setup-ndk | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r27 | |
local-cache: false | |
- name: Setup Path | |
run: | | |
echo "${{ env.ROOT }}/google/depot_tools" >> $GITHUB_PATH | |
- name: Build V8 | |
run: | | |
cd ${{ env.ROOT }} | |
mkdir google | |
cd google | |
git clone --depth=10 --branch=main https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
cd depot_tools | |
git checkout remotes/origin/main | |
cd .. | |
fetch v8 | |
cd v8 | |
git checkout ${{ env.JAVET_V8_VERSION }} | |
./build/install-build-deps.sh | |
cd .. | |
echo 'target_os = ["android"]' >> .gclient | |
gclient sync -D | |
cd v8 | |
python3 tools/dev/v8gen.py ${{ matrix.v8_release }}.release -- 'target_os="android"' 'target_cpu="${{ matrix.v8_arch }}"' 'v8_target_cpu="${{ matrix.v8_arch }}"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false ${{ matrix.v8_flag }} v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false | |
ninja -C out.gn/${{ matrix.v8_release }}.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./ | |
ninja -C out.gn/${{ matrix.v8_release }}.release v8_monolith | |
mv out.gn out.gn.${{ matrix.i18n_name }} | |
- name: Copy the i18n | |
if: matrix.i18n_name == 'i18n' && matrix.android_arch == 'arm64' | |
run: | | |
mkdir icu-v8 | |
cp ../google/v8/third_party/icu/android/*.dat icu-v8 | |
- name: Setup JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 11 | |
- name: Setup Cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.23.x' | |
- name: Build Javet JNI | |
run: | | |
cd ${{ env.ROOT }}/Javet/cpp | |
sh ./build-android.sh -DV8_DIR=${{ env.ROOT }}/google/v8 -DCMAKE_ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }} -DCMAKE_ANDROID_ARCH=${{ matrix.android_arch }} ${{ matrix.cmake_flag }} | |
- name: Upload the Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: javet-android-v8-${{ matrix.android_arch }}-${{ env.JAVET_VERSION }}-${{ matrix.i18n_name }} | |
path: android/javet-android/src/main/jniLibs/${{ matrix.android_abi }}/*.so | |
- name: Upload the i18n | |
uses: actions/upload-artifact@v4 | |
if: matrix.i18n_name == 'i18n' && matrix.android_arch == 'arm64' | |
with: | |
name: icu-v8 | |
path: icu-v8/*.dat | |
build_javet_aar: | |
needs: [build_javet_lib] | |
name: Build Javet AAR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 17 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
gradle-version: 8.10.2 | |
- name: Prepare JNI Libs | |
run: | | |
mkdir -p android/javet-android/src/main/jniLibs/armeabi-v7a | |
mkdir -p android/javet-android/src/main/jniLibs/arm64-v8a | |
mkdir -p android/javet-android/src/main/jniLibs/x86 | |
mkdir -p android/javet-android/src/main/jniLibs/x86_64 | |
- name: Download Javet arm64 i18n | |
uses: actions/download-artifact@v4 | |
with: | |
name: javet-android-v8-arm64-${{ env.JAVET_VERSION }}-i18n | |
path: android/javet-android/src/main/jniLibs/arm64-v8a | |
- name: Download Javet x86_64 i18n | |
uses: actions/download-artifact@v4 | |
with: | |
name: javet-android-v8-x86_64-${{ env.JAVET_VERSION }}-i18n | |
path: android/javet-android/src/main/jniLibs/x86_64 | |
- name: Download Javet arm non-i18n | |
uses: actions/download-artifact@v4 | |
with: | |
name: javet-android-v8-arm-${{ env.JAVET_VERSION }}-non-i18n | |
path: android/javet-android/src/main/jniLibs/armeabi-v7a | |
- name: Download Javet arm64 non-i18n | |
uses: actions/download-artifact@v4 | |
with: | |
name: javet-android-v8-arm64-${{ env.JAVET_VERSION }}-non-i18n | |
path: android/javet-android/src/main/jniLibs/arm64-v8a | |
- name: Download Javet x86 non-i18n | |
uses: actions/download-artifact@v4 | |
with: | |
name: javet-android-v8-x86-${{ env.JAVET_VERSION }}-non-i18n | |
path: android/javet-android/src/main/jniLibs/x86 | |
- name: Download Javet x86_64 non-i18n | |
uses: actions/download-artifact@v4 | |
with: | |
name: javet-android-v8-x86_64-${{ env.JAVET_VERSION }}-non-i18n | |
path: android/javet-android/src/main/jniLibs/x86_64 | |
- name: Build the Artifact | |
run: | | |
cd ${{ env.ROOT }}/Javet/scripts/python | |
python3 patch_android_build.py | |
cd ${{ env.ROOT }}/Javet/android | |
gradle build --debug | |
- name: Upload the Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: javet-android-v8-${{ env.JAVET_VERSION }} | |
path: android/javet-android/build/outputs/aar/javet*release.aar | |
- name: Delete Javet arm i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-arm-${{ env.JAVET_VERSION }}-i18n | |
- name: Delete Javet arm64 i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-arm64-${{ env.JAVET_VERSION }}-i18n | |
- name: Delete Javet x86 i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-x86-${{ env.JAVET_VERSION }}-i18n | |
- name: Delete Javet x86_64 i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-x86_64-${{ env.JAVET_VERSION }}-i18n | |
- name: Delete Javet arm non-i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-arm-${{ env.JAVET_VERSION }}-non-i18n | |
- name: Delete Javet arm64 non-i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-arm64-${{ env.JAVET_VERSION }}-non-i18n | |
- name: Delete Javet x86 non-i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-x86-${{ env.JAVET_VERSION }}-non-i18n | |
- name: Delete Javet x86_64 non-i18n | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: javet-android-v8-x86_64-${{ env.JAVET_VERSION }}-non-i18n |