-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a68eba3
commit f74d2eb
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# build a docker image with android build tooling | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
image: | ||
default: ghcr.io/viam-labs/rdk-apk | ||
tag: | ||
default: latest | ||
|
||
jobs: | ||
base-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: build | ||
run: docker build -t ${{ inputs.image }}:${{ inputs.tag }} . | ||
- name: push | ||
run: docker push -t ${{ inputs.image }}:${{ inputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# base image for APK builds | ||
FROM ubuntu:latest | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt apt-get update | ||
# sdkmanager requires 21 jre, we build on old jdk because we target old droid. (not sure old jdk is necessary though) | ||
# make...python3 for tflite build | ||
# nasm for x264 | ||
# golang for rdk | ||
RUN --mount=type=cache,target=/var/cache/apt apt-get install -qy \ | ||
zip \ | ||
openjdk-11-jdk-headless openjdk-21-jre-headless \ | ||
make curl patch cmake git python3 \ | ||
nasm \ | ||
golang-1.21-go | ||
|
||
ENV ANDROID_HOME /droid | ||
ENV ANDROID_SDK_ROOT /droid | ||
|
||
WORKDIR ${ANDROID_SDK_ROOT} | ||
|
||
# https://developer.android.com/studio#command-line-tools-only | ||
ARG CLI_TOOLS=commandlinetools-linux-11076708_latest.zip | ||
RUN curl --fail --silent --show-error -o ${CLI_TOOLS} https://dl.google.com/android/repository/${CLI_TOOLS} && unzip -q ${CLI_TOOLS} && rm ${CLI_TOOLS} | ||
|
||
ENV PATH ${PATH}:/droid/cmdline-tools/bin | ||
ARG NDK_VERSION=26.2.11394342 | ||
ENV NDK_ROOT ${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION} | ||
|
||
RUN yes | sdkmanager --sdk_root=$(realpath .) --install "platforms;android-28" "build-tools;26.0.3" "ndk;${NDK_VERSION}" | ||
|
||
ENV PATH ${PATH}:/usr/lib/go-1.21/bin:/root/go/bin | ||
|
||
RUN go install golang.org/x/mobile/cmd/gomobile@latest | ||
RUN gomobile init |