Skip to content

ci: scope publish build to library modules + add job timeout#16

Merged
Fiona2016 merged 1 commit into
publishfrom
ci/scope-publish-build
May 31, 2026
Merged

ci: scope publish build to library modules + add job timeout#16
Fiona2016 merged 1 commit into
publishfrom
ci/scope-publish-build

Conversation

@Fiona2016
Copy link
Copy Markdown
Collaborator

@Fiona2016 Fiona2016 commented May 31, 2026

Problem

The publish job's Build project step ran ./gradlew clean assembleRelease, which assembles the entire project — including the sample apps (sample/*, each with Us1Us5 product flavors), plus benchmark and tools modules. None of those are published, but they dominate the build: a recent snapshot run sat in this step for 2h+ (3800+ Gradle tasks, mostly :sample:wear:*Us{1..5}Release). The job also had no timeout-minutes, so a stuck build can run up to GitHub's 6h default.

Change

  • Replace the project-wide assembleRelease + separate testReleaseUnitTest steps with a single scoped step: ./gradlew clean bundleReleaseAar testReleaseUnitTest.
    • bundleReleaseAar is an Android-library-only task — it packages each publishable module's .aar. The sample application modules produce APK/AAB and have no AAR task, so they're skipped automatically. This keeps a real, fail-fast artifact-packaging gate before publishing, without building the sample apps.
    • testReleaseUnitTest compiles and tests the library release sources.
  • Add timeout-minutes: 90 so a stuck build is killed instead of running to the 6h default. 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 minutes, which are free on this public repo.

Why this is the right scope

  • bundleReleaseAar is robust to upstream syncs: any new library module is included automatically, any new application module is excluded automatically — no hand-maintained module list. (Verified via --dry-run: the heavy sample:kotlin/wear/tv/automotive app modules are not in the task graph; only library modules are.)
  • The existing publishAllPublicationsToMavenCentralRepository step still assembles + signs + uploads exactly the publishable modules.

@Fiona2016 Fiona2016 force-pushed the ci/scope-publish-build branch from c0384ce to 852a320 Compare May 31, 2026 03:03
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 <noreply@anthropic.com>
@Fiona2016 Fiona2016 force-pushed the ci/scope-publish-build branch from 852a320 to f2039e0 Compare May 31, 2026 03:15
@Fiona2016 Fiona2016 merged commit 43064b1 into publish May 31, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant