Skip to content

Commit

Permalink
per-platform builds in CI for faster install, make rename tweak, RDK_…
Browse files Browse the repository at this point in the history
…PATH tweak
  • Loading branch information
abe-winter committed Apr 10, 2024
1 parent f4d9d07 commit 3523db4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
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
Expand All @@ -34,25 +35,30 @@ jobs:
# 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
# todo: per-platorm AAR so this is 2 x 100mb instead of 200mb
- 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 APK
- name: build APKs
working-directory: rdk-apk
shell: bash
run: |
export RDK_PATH=$(realpath ../rdk)
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?
gradle --no-daemon assembleDebug
- name: rename
run: |
mkdir dist
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).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:
path: dist
name: x86 APK
path: dist/*.x86_64.apk
if-no-files-found: error
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RDK_SHA ?= RDK_SHA
RDK_SHA ?= $(shell cd /usr/local/src/rdk && git describe --tags)

.PHONY:
rename-apk: app/build/outputs/apk/debug/app-debug.apk
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
implementation("androidx.compose.runtime:runtime-livedata:1.6.4")
implementation("com.google.android.material:material:1.9.0")
implementation("com.jakewharton:process-phoenix:3.0.0")
implementation(files("${(System.getenv("RDK_PATH") ?: "").ifEmpty {"/usr/local/src/rdk"} }/droid-rdk.aar"))
implementation(files((System.getenv("RDK_PATH") ?: "").ifEmpty {"/usr/local/src/rdk/droid-rdk.aar"}))
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
Expand Down

0 comments on commit 3523db4

Please sign in to comment.