Files
android/.gitea/workflows/builder-image.yml
Robert Helewka 605df9bdbf
All checks were successful
build-android-builder-image / build-image (push) Successful in 2m49s
build: target amd64 — Google ships no arm64 Linux build-tools
The image pinned build-tools 36.0.0, whose aapt2/d8 are x86_64-only (Google
publishes no arm64 Linux build-tools). Built for and run on arm64, packaging
died with `aapt2: Syntax error: newline unexpected` (an x86_64 binary the
kernel can't exec).

Build the image for linux/amd64 on an amd64 runner, and point the template +
README at ubuntu-24.04. The APK output is architecture-neutral, so this costs
nothing downstream. Also execute aapt2 in the image sanity check so an arch
mismatch fails the image build, not every app build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 22:53:07 -04:00

59 lines
1.7 KiB
YAML

name: build-android-builder-image
# Builds the Android toolchain image and pushes it to the Gitea registry.
# Push a tag like `2026.06` to cut an immutable toolchain; pushes to main
# refresh the moving `latest` tag.
on:
push:
branches: [main]
tags: ["*"]
workflow_dispatch:
env:
REGISTRY: git.helu.ca
IMAGE: git.helu.ca/r/android
jobs:
build-image:
# amd64: Google ships the Linux build-tools (aapt2, d8) for x86_64 only,
# so the toolchain must be built for and run on amd64.
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
# Determine which tags to push:
# - a git tag -> use it verbatim (e.g. 2026.06) + latest
# - main branch -> latest only
- name: Compute tags
id: tags
run: |
if [ "${{ gitea.ref_type }}" = "tag" ]; then
REF="${{ gitea.ref_name }}"
echo "tags=${IMAGE}:${REF},${IMAGE}:latest" >> "$GITHUB_OUTPUT"
else
echo "tags=${IMAGE}:latest" >> "$GITHUB_OUTPUT"
fi
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGE_TOKEN }}
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push (linux/amd64)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.tags.outputs.tags }}
# Bump these here if you want to override the Dockerfile defaults
# build-args: |
# BUILD_TOOLS_VERSION=35.0.0
# PLATFORM_VERSION=android-35