forked from libusb/libusb
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.57 KB
/
android.yml
File metadata and controls
55 lines (47 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Android
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
abi: [arm64-v8a, armeabi-v7a, x86_64]
api: [21]
env:
ANDROID_ABI: ${{ matrix.abi }}
ANDROID_API: ${{ matrix.api }}
NDK_OUT_DIR: ${{ github.workspace }}/out/${{ matrix.abi }}
NDK_LIBS_DIR: ${{ github.workspace }}/libs/${{ matrix.abi }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show ANDROID_NDK_ROOT
run: |
echo "ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT}"
test -d "${ANDROID_NDK_ROOT}" || (echo "ANDROID_NDK_ROOT not set or invalid" && exit 1)
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y file
- name: Build with ndk-build
working-directory: android/jni
run: |
mkdir -p "${NDK_OUT_DIR}" "${NDK_LIBS_DIR}"
"${ANDROID_NDK_ROOT}/ndk-build" -j \
APP_ABI="${ANDROID_ABI}" \
APP_PLATFORM="android-${ANDROID_API}" \
NDK_OUT="${NDK_OUT_DIR}" \
NDK_LIBS_OUT="${NDK_LIBS_DIR}"
- name: Show outputs
run: |
set -euxo pipefail
find "${NDK_LIBS_DIR}" -maxdepth 2 -type f -print0 | xargs -0 ls -lh || true
file "${NDK_LIBS_DIR}/"* || true
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: libusb-android-${{ matrix.abi }}-api${{ matrix.api }}
path: |
libs/${{ matrix.abi }}/
if-no-files-found: error