Skip to content

Commit

Permalink
Update CI to build aar
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Dec 12, 2024
1 parent 345c140 commit 28f0348
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ concurrency:

jobs:
build-android-libs:
name: Android for ${{ matrix.os }}
name: Android libs
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -44,6 +44,11 @@ jobs:
with:
fetch-depth: 0

- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-android-jni

- name: Display NDK HOME
shell: bash
run: |
Expand All @@ -53,6 +58,9 @@ jobs:
- name: build android arm64-v8a
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME
./build-android-arm64-v8a.sh
mkdir -p jniLibs/arm64-v8a/
Expand All @@ -62,6 +70,9 @@ jobs:
- name: build android armv7-eabi
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME
./build-android-armv7-eabi.sh
mkdir -p ./jniLibs/armeabi-v7a/
Expand All @@ -71,6 +82,9 @@ jobs:
- name: build android x86_64
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME
./build-android-x86-64.sh
mkdir -p ./jniLibs/x86_64
Expand All @@ -80,6 +94,9 @@ jobs:
- name: build android x86
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME
./build-android-x86.sh
mkdir -p ./jniLibs/x86
Expand Down Expand Up @@ -143,3 +160,33 @@ jobs:
file_glob: true
overwrite: true
file: sherpa-onnx-*-android.tar.bz2

build-android-aar:
needs: [build-android-libs]
name: Android AAR
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Display NDK HOME
shell: bash
run: |
echo "ANDROID_NDK_LATEST_HOME: ${ANDROID_NDK_LATEST_HOME}"
ls -lh ${ANDROID_NDK_LATEST_HOME}
- name: Retrieve artifact
uses: actions/download-artifact@v4
with:
name: sherpa-onnx-android-libs
path: /tmp/jniLibs

- name: Show jni libs
shell: bash
run: |
ls -lh /tmp/jniLibs

0 comments on commit 28f0348

Please sign in to comment.