Actions: Set minimum SDK version to 21

This commit is contained in:
Iscle 2023-05-16 01:57:13 +02:00
parent 4826177dac
commit 213cd3ce25

View File

@ -4,17 +4,22 @@ on: [push, pull_request]
env: env:
NDK_VERSION: 25.2.9519653 NDK_VERSION: 25.2.9519653
MIN_SDK_VERSION: 21
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
abi: ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache NDK - name: Cache NDK
id: ndk-cache id: ndk-cache
uses: actions/cache@v3 uses: actions/cache@v2
with: with:
path: ndk path: ndk
key: ndk-${{ env.NDK_VERSION }} key: ndk-${{ env.NDK_VERSION }}
@ -30,36 +35,22 @@ jobs:
- name: Set NDK environment variable - name: Set NDK environment variable
run: echo "ANDROID_NDK_HOME=$(pwd)/ndk" >> $GITHUB_ENV run: echo "ANDROID_NDK_HOME=$(pwd)/ndk" >> $GITHUB_ENV
- name: Build with CMake for arm - name: Build with CMake
run: | run: |
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a . cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.abi }} -DANDROID_PLATFORM=android-${{ env.MIN_SDK_VERSION }} .
cmake --build . -- -j$(nproc) cmake --build . -- -j$(nproc)
env:
BUILD_TYPE: 'arm'
- name: Rename and move output for arm - name: Rename and move output
run: | run: |
mv libv4a_re.so libv4a_re_arm.so mv libv4a_re.so libv4a_re_${{ matrix.abi }}.so
- name: Clean build - name: Clean build
run: | run: |
cmake --build . --target clean cmake --build . --target clean
- name: Build with CMake for arm64
run: |
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a .
cmake --build . -- -j$(nproc)
env:
BUILD_TYPE: 'arm64'
- name: Rename and move output for arm64
run: |
mv libv4a_re.so libv4a_re_arm64.so
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: compiled-binaries name: compiled-binaries
path: | path: |
libv4a_re_arm.so libv4a_re_*.so
libv4a_re_arm64.so