From 89258e5baa6356afde4386f0db16dddc99b8d1f4 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 21 May 2026 20:52:25 -0700 Subject: [PATCH 1/2] fall back to stub external_api_keys.dart on fork PRs --- .github/workflows/test.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 585e2d9a7..eca0145f8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,7 +43,21 @@ jobs: env: CHANGE_NOW: ${{ secrets.CHANGE_NOW }} run: | - echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart + if [ -n "$CHANGE_NOW" ]; then + echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart + else + cat > lib/external_api_keys.dart << 'EOF' + const String kChangeNowApiKey = ""; + const String kSimpleSwapApiKey = ""; + const String kNanswapApiKey = ""; + const String kNanoSwapRpcApiKey = ""; + const String kWizSwapApiKey = ""; + const kShopInBitAccessKey = ""; + const kShopInBitPartnerSecret = ""; + const kCakePayApiToken = ""; + const kExolixApiKey = ""; + EOF + fi - name: Ensure app config for tests run: bash scripts/ensure_test_app_config.sh From 7c5c44f657c567e7796815ad22a34463728ba52d Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 21 May 2026 21:16:06 -0700 Subject: [PATCH 2/2] ci: add android Docker stage to fix build-android disk exhaustion --- .github/workflows/build-ci-image.yaml | 10 ++++ .github/workflows/build.yaml | 8 ++- Dockerfile | 79 +++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-ci-image.yaml b/.github/workflows/build-ci-image.yaml index 066290576..5cc34c0c9 100644 --- a/.github/workflows/build-ci-image.yaml +++ b/.github/workflows/build-ci-image.yaml @@ -40,6 +40,16 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + - name: Build and push android image + uses: docker/build-push-action@v7 + with: + context: . + target: android + push: true + tags: ${{ env.GHCR_IMAGE }}:android + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Build and push test image uses: docker/build-push-action@v7 with: diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e9dd3ed29..35478b749 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -102,7 +102,7 @@ jobs: contents: read packages: read container: - image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest + image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:android credentials: username: ${{ github.actor }} password: ${{ github.token }} @@ -190,6 +190,12 @@ jobs: - name: Build APKs run: flutter build apk --split-per-abi --release + - name: Clean intermediates before AAB + run: | + rm -rf build/app/intermediates + rm -rf build/app/tmp + find build -name '*.o' -delete 2>/dev/null || true + - name: Build AAB run: flutter build appbundle --release diff --git a/Dockerfile b/Dockerfile index 028b9e499..265b9d86a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,6 +88,85 @@ RUN git config --system --add safe.directory '*' RUN flutter --version && rustc --version && cargo --version && node --version && go version +# Android-only image: no Linux/Windows cross-compilers, no OpenCV/OpenCL, single Rust toolchain with android targets +FROM ubuntu:24.04 AS android + +ENV DEBIAN_FRONTEND=noninteractive \ + TZ=Etc/UTC \ + LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates curl file git gnupg python3 sudo unzip xz-utils \ + build-essential cmake ninja-build pkg-config \ + libssl-dev zlib1g-dev \ + openjdk-21-jdk-headless \ + && rm -rf /var/lib/apt/lists/* + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --default-toolchain 1.89.0 --profile minimal --no-modify-path \ + && rustup target add \ + aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android \ + --toolchain 1.89.0 \ + && cargo install cargo-ndk \ + && chmod -R a+rwX "$CARGO_HOME" "$RUSTUP_HOME" + +ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 + +ENV ANDROID_SDK_ROOT=/opt/android-sdk \ + ANDROID_HOME=/opt/android-sdk \ + ANDROID_NDK_ROOT=/opt/android-sdk/ndk/28.2.13676358 \ + ANDROID_NDK_HOME=/opt/android-sdk/ndk/28.2.13676358 \ + PATH=/opt/android-sdk/cmdline-tools/latest/bin:/opt/android-sdk/platform-tools:$PATH + +RUN mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools" \ + && curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-14742923_latest.zip \ + -o /tmp/cmdline-tools.zip \ + && echo "48833c34b761c10cb20bcd16582129395d121b27 /tmp/cmdline-tools.zip" | sha1sum -c \ + && unzip -q /tmp/cmdline-tools.zip -d "$ANDROID_SDK_ROOT/cmdline-tools" \ + && mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest" \ + && rm /tmp/cmdline-tools.zip \ + && mkdir -p "$ANDROID_SDK_ROOT/licenses" \ + && printf '\n24333f8a63b6825ea9c5514f83c2829b004d1fee\n8933bad161af4178b1185d1a37fbf41ea5269c55d7b9237478ea8ec3307c27e4' \ + > "$ANDROID_SDK_ROOT/licenses/android-sdk-license" \ + && printf '\n84831b9409646a918e30573bab4c9c91346d8abd' \ + > "$ANDROID_SDK_ROOT/licenses/android-sdk-preview-license" \ + && printf '\n859f317696f67ef3d7f30a50a5560e7834b43903' \ + > "$ANDROID_SDK_ROOT/licenses/android-sdk-arm-dbt-license" \ + && sdkmanager \ + "platform-tools" \ + "build-tools;35.0.0" \ + "platforms;android-35" \ + "ndk;28.2.13676358" \ + && chmod -R a+rwX "$ANDROID_SDK_ROOT" + +ENV PATH=/usr/local/go/bin:$PATH + +RUN curl -fsSL https://go.dev/dl/go1.24.13.linux-amd64.tar.gz -o /tmp/go.tar.gz \ + && echo "1fc94b57134d51669c72173ad5d49fd62afb0f1db9bf3f798fd98ee423f8d730 /tmp/go.tar.gz" | sha256sum -c \ + && tar -C /usr/local -xzf /tmp/go.tar.gz \ + && rm /tmp/go.tar.gz + +ENV FLUTTER_HOME=/opt/flutter \ + PATH=/opt/flutter/bin:/opt/flutter/bin/cache/dart-sdk/bin:$PATH + +RUN git clone --depth 1 --branch 3.38.1 https://github.com/flutter/flutter.git "$FLUTTER_HOME" \ + && git config --global --add safe.directory '*' \ + && flutter config --no-analytics \ + && flutter precache --android \ + && chmod -R a+rwX "$FLUTTER_HOME" + +RUN git config --system --add safe.directory '*' + +RUN flutter --version && rustc --version && cargo --version && go version + + # Minimal image for flutter test (no Rust, no Android SDK, no cross-compilers) FROM ubuntu:24.04 AS test