From f2039e0654b9f409ae6339c5f8db7e1ca8bdd991 Mon Sep 17 00:00:00 2001 From: Fiona Date: Sun, 31 May 2026 10:50:11 +0800 Subject: [PATCH] ci: scope publish build to library modules, add job timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish job ran `./gradlew clean assembleRelease`, which assembles the entire project — including the sample apps (sample/*, each with Us1–Us5 flavors), benchmark and tooling modules — none of which are published. That pushed the build past 2 hours. - Replace the project-wide `assembleRelease` with `clean bundleReleaseAar testReleaseUnitTest`. `bundleReleaseAar` is an Android-library-only task, so it packages every publishable library's AAR (a real fail-fast build gate) while skipping the sample application modules, which produce APK/AAB and have no AAR task. `testReleaseUnitTest` compiles and tests the library release sources. The publish task below then uploads exactly the publishable modules. - Add `timeout-minutes: 90` so a stuck build is killed instead of running up to GitHub's 6h default. The limit is loose on purpose: a known-good release run has taken ~52 min and the Maven Central upload is network-bound, so a tighter cap risks killing legitimately-slow publishes; an over-run only wastes extra minutes, which are free on this public repo. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/publish-maven.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-maven.yml b/.github/workflows/publish-maven.yml index 3f12ec9cd6..3fa0aa448c 100644 --- a/.github/workflows/publish-maven.yml +++ b/.github/workflows/publish-maven.yml @@ -11,6 +11,12 @@ on: jobs: publish: runs-on: ubuntu-latest + # Bound the job so a stuck Gradle build is killed instead of running up to + # GitHub's 6h default. Headroom is deliberate: a known-good release run has + # taken ~52 min, and the Maven Central upload is network-bound, so a tight + # limit would kill legitimately-slow publishes. A hang only wastes the extra + # minutes (free on this public repo), so we err loose. + timeout-minutes: 90 steps: - name: Checkout code @@ -40,11 +46,18 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Build project - run: ./gradlew clean assembleRelease --stacktrace - - - name: Run tests - run: ./gradlew testReleaseUnitTest --stacktrace + # Build the library AARs and run unit tests, scoped to the SDK libraries. + # We deliberately do NOT run a project-wide `assembleRelease`: that also + # assembles every sample app (sample/* with the Us1–Us5 flavors), plus the + # benchmark and tooling modules — none of which are published, and which + # previously pushed this job past 2 hours. + # `bundleReleaseAar` is an Android-library-only task, so the sample + # application modules (which produce APK/AAB, not AAR) are skipped + # automatically; it packages the real artifacts as a fail-fast gate before + # publishing. `testReleaseUnitTest` compiles and tests the library release + # sources. + - name: Build and test SDK library modules + run: ./gradlew clean bundleReleaseAar testReleaseUnitTest --stacktrace - name: Stop Gradle Daemon run: ./gradlew --stop