diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index cea4f87..1eb8c0d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -25,6 +25,29 @@ jobs: with: packages: platform-tools platforms;android-37.0 + # The mac-mini runner's containers are arm64, while AGP's aapt2 is built for x86-64 only. + # OrbStack runs it through Rosetta, once the x86-64 glibc it links against is installed. + - name: Install the x86-64 glibc + run: | + if [ "$(uname -m)" != aarch64 ]; then exit 0; fi + # Ubuntu serves amd64 packages from a different archive than arm64 ones. + sed -i '/^URIs:/a Architectures: arm64' /etc/apt/sources.list.d/ubuntu.sources + cat > /etc/apt/sources.list.d/amd64.sources < /dev/null 2>&1 && break + sleep 5 + done + apt-get install -y -qq --no-install-recommends libc6:amd64 + - run: ./gradlew testDebugUnitTest lint assembleDebug # Gitea's artifact backend speaks the v3 protocol only. diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index a94d2fa..a20b322 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -34,6 +34,26 @@ jobs: with: packages: platform-tools platforms;android-37.0 + # aapt2 is x86-64 only, see ci.yml. + - name: Install the x86-64 glibc + run: | + if [ "$(uname -m)" != aarch64 ]; then exit 0; fi + sed -i '/^URIs:/a Architectures: arm64' /etc/apt/sources.list.d/ubuntu.sources + cat > /etc/apt/sources.list.d/amd64.sources < /dev/null 2>&1 && break + sleep 5 + done + apt-get install -y -qq --no-install-recommends libc6:amd64 + - name: Read versions id: versions run: |