-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (63 loc) · 2.4 KB
/
build.yml
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
56
57
58
59
60
61
62
63
64
# build
on:
workflow_dispatch:
inputs:
repository:
default: viamrobotics/rdk
ref:
default: main
jobs:
daily:
runs-on: buildjet-8vcpu-ubuntu-2204
container: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v4
with:
path: rdk-apk
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
path: rdk
fetch-tags: true # need tags for git describe
fetch-depth: '250' # for git describe
# todo: put tflite and x264 in same etc/android/prefix, then try pkgconfig
# todo: look at short-lived cache of etc/android/prefix
- name: build x264
if: hashFiles('rdk/etc/android/build-x264.sh') != ''
working-directory: rdk
run: |
make etc/android/prefix/aarch64
make etc/android/prefix/x86_64
- name: build tflite
working-directory: rdk
# we need tflite headers but not the full build. add SRC_ONLY flag
# if: false
run: ANDROID_NDK=$NDK_ROOT KEEP_TFLITE_SRC=1 etc/android/build-tflite.sh
- name: build AAR
working-directory: rdk
run: CGO_CFLAGS="-I $HOME/tensorflow/tensorflow-2.12.0" PLATFORM_NDK_ROOT=$NDK_ROOT NDK_ROOT=$NDK_ROOT make droid-rdk.aar
# todo: pass down APK + RDK version information
- name: build APKs
working-directory: rdk-apk
shell: bash
run: |
mkdir ../dist
source $SDKMAN_DIR/bin/sdkman-init.sh
# todo(review): is it safe to use gradle in path instead of gradlew? or way to make gradlew use system gradle?
RDK_PATH=$(realpath ../rdk/droid-rdk.arm64.aar) gradle --no-daemon assembleDebug
mv rdk-apk/app/build/outputs/apk/debug/app-debug.apk \
../dist/rdk-$(date +%y%m%d)-$(cd ../rdk && git describe --tags)-$(cd rdk-apk && git rev-parse --short HEAD).aarch64.apk
RDK_PATH=$(realpath ../rdk/droid-rdk.amd64.aar) gradle --no-daemon assembleDebug
mv rdk-apk/app/build/outputs/apk/debug/app-debug.apk \
../dist/rdk-$(date +%y%m%d)-$(cd ../rdk && git describe --tags)-$(cd rdk-apk && git rev-parse --short HEAD).x86_64.apk
- uses: actions/upload-artifact@v4
with:
name: Arm APK
path: dist/*.aarch64.apk
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: x86 APK
path: dist/*.x86_64.apk
if-no-files-found: error