Build the Android app on our own Gitea runner

Pushing a v* tag builds the normal and FOSS APKs, signed with the upload
key, and attaches them to a Gitea release; a manual run on a branch
uploads a test build to the repo's packages. Everything runs on the
Gitea server: a builder image with the Android SDK, an act_runner
registered only for this repo, and plain shell steps (no third-party
actions). The build itself is apps/mobile/scripts/build-android.sh, the
same script for hand builds. Setup steps are in docs/ANDROID-CI.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 21:28:52 -04:00
co-authored by Claude Opus 5.5
parent 68ec5a8d99
commit 3b39910f13
7 changed files with 316 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
# Build environment for the Android app, used by the Gitea Actions workflow
# (.gitea/workflows/android.yml). Build it on the machine running the runner:
#
# docker build -t musicshare-android-builder deploy/android-builder
#
# Versions match what React Native 0.86 / Expo 57 ask for
# (node_modules/react-native/gradle/libs.versions.toml). Gradle downloads anything
# else it needs on first use; the workflow keeps ~/.gradle in a volume.
FROM node:22-bookworm
RUN apt-get update \
&& apt-get install -y --no-install-recommends openjdk-17-jdk-headless unzip \
&& rm -rf /var/lib/apt/lists/*
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 \
ANDROID_HOME=/opt/android-sdk \
ANDROID_SDK_ROOT=/opt/android-sdk
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
# Checksum from https://developer.android.com/studio#command-line-tools-only
ARG CMDLINE_TOOLS=commandlinetools-linux-15859902_latest.zip
ARG CMDLINE_TOOLS_SHA256=4e4c464f145a7512b57d088ac6c278c03c9eea610886b35a5e0804e74eedf583
RUN curl -fsSLo /tmp/tools.zip https://dl.google.com/android/repository/$CMDLINE_TOOLS \
&& echo "$CMDLINE_TOOLS_SHA256 /tmp/tools.zip" | sha256sum -c \
&& mkdir -p $ANDROID_HOME/cmdline-tools \
&& unzip -q /tmp/tools.zip -d $ANDROID_HOME/cmdline-tools \
&& mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest \
&& rm /tmp/tools.zip
RUN yes | sdkmanager --licenses > /dev/null \
&& sdkmanager --install \
"platform-tools" \
"platforms;android-36" \
"build-tools;36.0.0" \
"ndk;27.1.12297006" \
"cmake;3.22.1" > /dev/null \
&& chmod -R a+rwX $ANDROID_HOME