CI: build the APK in the cluster's android-sdk image
Launcher / test (pull_request) Failing after 5m41s
Launcher / apk (pull_request) Skipped

apk job uses git.site.latha.org/cluster-services/android-sdk:latest; gitea-apk.sh
uses the image's JDK/SDK when present and falls back to installing them
(documented, for use with node:22-bookworm until the image is built).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SpriteandClaude Sonnet 5.5 committed 2026-11-23 01:15:50 +00:00
1 parent 67b6b58c94
commit a8ce535f37
3 files changed
+25 -11

No files matched your search

+5 -1
View File
@@ -46,8 +46,12 @@ jobs:
needs: test needs: test
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
# JDK 17 + Android SDK (platforms;android-35, build-tools 35.0.0, NDK) prebuilt by
# charts/android-sdk in nandi/cluster, so no per-run SDK download. Fallback until that image
# is built and pullable: use `node:22-bookworm` here; ci/gitea-apk.sh then installs the JDK
# and downloads the SDK pieces itself.
container: container:
image: node:22-bookworm image: git.site.latha.org/cluster-services/android-sdk:latest
timeout-minutes: 40 timeout-minutes: 40
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
+1 -1
View File
@@ -80,7 +80,7 @@ To try the page in a desktop browser: `scripts/build-web.sh --demo && python3 -m
## CI and releases ## CI and releases
`.gitea/workflows/launcher.yml`: a `test` job (MoonBit installed like in identicons-web, inside `node:22-bookworm`; `moon test` on js and wasm-gc, then the Playwright tests) and, on push to `main`, an `apk` job running `ci/gitea-apk.sh`, which builds the APK and publishes a Gitea release `build-<versionCode>` holding `ultra-launcher.apk` and `version.json` (a draft first, published once both files are up). The installed app compares that `versionCode` with its own and installs the newer APK. No `actions/setup-node`, no docker, every job has a `timeout-minutes`. `.gitea/workflows/launcher.yml`: a `test` job (MoonBit installed like in identicons-web, inside `node:22-bookworm`; `moon test` on js and wasm-gc, then the Playwright tests) and, on push to `main`, an `apk` job (container `git.site.latha.org/cluster-services/android-sdk:latest` from `charts/android-sdk` in nandi/cluster: JDK 17 + SDK 35, no per-run download; swap in `node:22-bookworm` as a fallback until it exists, the script then downloads the SDK itself) running `ci/gitea-apk.sh`, which builds the APK and publishes a Gitea release `build-<versionCode>` holding `ultra-launcher.apk` and `version.json` (a draft first, published once both files are up). The installed app compares that `versionCode` with its own and installs the newer APK. No `actions/setup-node`, no docker, every job has a `timeout-minutes`.
Releases of the app's version are managed with [sweet](https://github.com/chattocorp/sweet-release): `.sweet.config.yml` (feature → minor, fix/performance → patch, chore/refactor → none) and `.sweet.yml` (`moon.mod`'s `version` line is annotated `// sweet-version`). The Android `versionName` is read from `moon.mod` by the build, so that is the one file that carries the version. Releases of the app's version are managed with [sweet](https://github.com/chattocorp/sweet-release): `.sweet.config.yml` (feature → minor, fix/performance → patch, chore/refactor → none) and `.sweet.yml` (`moon.mod`'s `version` line is annotated `// sweet-version`). The Android `versionName` is read from `moon.mod` by the build, so that is the one file that carries the version.
+19 -9
View File
@@ -13,23 +13,33 @@ export VERSION_CODE=$(( $(date +%s) / 60 ))
COMMIT="${GITHUB_SHA:-$(git rev-parse HEAD)}" COMMIT="${GITHUB_SHA:-$(git rev-parse HEAD)}"
echo "== tools" echo "== tools"
# In the cluster's android-sdk image the JDK, SDK and common tools are already there; on a bare
# image (the documented fallback, e.g. node:22-bookworm) they are installed below.
if ! command -v javac >/dev/null || ! command -v zip >/dev/null || ! command -v curl >/dev/null; then
apt-get update -qq apt-get update -qq
apt-get install -y -qq --no-install-recommends openjdk-17-jdk-headless unzip zip curl ca-certificates git >/dev/null apt-get install -y -qq --no-install-recommends openjdk-17-jdk-headless unzip zip curl ca-certificates git >/dev/null
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash fi
command -v moon >/dev/null || [ -x "$HOME/.moon/bin/moon" ] || curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
export PATH="$HOME/.moon/bin:$PATH" export PATH="$HOME/.moon/bin:$PATH"
moon update moon update
echo "== Android SDK (build-tools and the platform jar only)" SDK="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-/opt/android-sdk}}"
export ANDROID_SDK_ROOT=/opt/android-sdk if [ -f "$SDK/platforms/android-35/android.jar" ] && ls -d "$SDK"/build-tools/35* >/dev/null 2>&1; then
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools" echo "== Android SDK from the image ($SDK)"
else
echo "== Android SDK fallback (build-tools and the platform jar only)"
SDK=/opt/android-sdk
mkdir -p "$SDK/cmdline-tools"
curl -fsSL -o /tmp/cmdline.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip curl -fsSL -o /tmp/cmdline.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip -q /tmp/cmdline.zip -d "$ANDROID_SDK_ROOT/cmdline-tools" unzip -q /tmp/cmdline.zip -d "$SDK/cmdline-tools"
mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest" mv "$SDK/cmdline-tools/cmdline-tools" "$SDK/cmdline-tools/latest"
yes | "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null || true yes | "$SDK/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null || true
"$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --install "build-tools;35.0.0" >/dev/null "$SDK/cmdline-tools/latest/bin/sdkmanager" --install "build-tools;35.0.0" >/dev/null
# Only android.jar is needed from the platform: unzipping the whole thing (sdkmanager) is slow. # Only android.jar is needed from the platform: unzipping the whole thing (sdkmanager) is slow.
curl -fsSL -o /tmp/platform.zip https://dl.google.com/android/repository/platform-35_r02.zip curl -fsSL -o /tmp/platform.zip https://dl.google.com/android/repository/platform-35_r02.zip
mkdir -p "$ANDROID_SDK_ROOT/platforms" && unzip -q /tmp/platform.zip 'android-35/android.jar' -d "$ANDROID_SDK_ROOT/platforms" mkdir -p "$SDK/platforms" && unzip -q /tmp/platform.zip 'android-35/android.jar' -d "$SDK/platforms"
fi
export ANDROID_SDK_ROOT="$SDK"
echo "== build (versionCode $VERSION_CODE)" echo "== build (versionCode $VERSION_CODE)"
android/build.sh ultra-launcher.apk android/build.sh ultra-launcher.apk