Skip to content

ci: migrate Maven Central publishing workflow to OSS Exit Gate - #1873

Open
zarturod wants to merge 1 commit into
googlemaps:mainfrom
zarturod:chore/oss-exit-gate-migration
Open

zarturod wants to merge 1 commit into
googlemaps:mainfrom
zarturod:chore/oss-exit-gate-migration

Conversation

@zarturod

Copy link
Copy Markdown

Summary

Migrates com.google.maps.android:android-maps-utils* Maven Central release publishing in .github/workflows/publish.yml to publish through Google's OSS Exit Gate (android-maps-utils/mavencentral).

Note for Googlers: OSS Exit Gate is an internal Google security initiative for securing open-source release publishing, hosted exclusively in google3 (see http://go/oss-exit-gate and tracking bug b/582481558).

Changes

  • Scopes job permissions (id-token: write) to the publishing job and pins Google Cloud GitHub Actions to 40-character commit SHAs (google-github-actions/auth, google-github-actions/setup-gcloud).
  • Authenticates via Google Cloud Workload Identity Federation (projects/305452601764/locations/global/workloadIdentityPools/builders/providers/github).
  • Cleans up any prior staged packages in Artifact Registry (oss-exit-gate-prod/android-maps-utils--mavencentral) before uploading to avoid stale artifacts.
  • Stages release artifacts to https://us-maven.pkg.dev/oss-exit-gate-prod/android-maps-utils--mavencentral and uploads manifest.json to gs://oss-exit-gate-prod-projects-bucket/android-maps-utils/mavencentral/manifests/ to trigger the OSS Exit Gate release pipeline.
  • Retains GPG signing (SYNCED_GPG_KEY_*), removes direct Sonatype credentials (SONATYPE_TOKEN*), and leaves .github/workflows/publish-snapshot.yml (unsigned -SNAPSHOT uploads) unchanged.

Verification (Production Smoke Test)

  • Production onboarding configuration (android-maps-utils/mavencentral) and infrastructure provisioning are live.
  • End-to-end Artifact Registry staging (com.google.maps.android:android-maps-utils@7.0.1: android-maps-utils-7.0.1.pom:HTTP_400_AlreadyStaged; android-maps-utils-7.0.1.aar:HTTP_400_AlreadyStaged) and GCS manifest upload (gs://oss-exit-gate-prod-projects-bucket/android-maps-utils/mavencentral/manifests/manifest-test-1795634338-283.json) passed.

References

@zarturod
zarturod requested review from a team and kikoso as code owners November 27, 2026 23:32
"publishing_groups": [
{
"namespace": "com.google.maps.android",
"packages": [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could avoid keeping this list in sync by hand. collections and bom already apply the publishing convention plugin but are not included in settings.gradle.kts, so the day someone includes them they will be staged but silently never released. If generating it from the staged packages is too much, is worth to add at least a comment pointing to settings.gradle.kts. What do you think?

--project=oss-exit-gate-prod \
--location=us \
--repository=android-maps-utils--mavencentral \
--format='value(name)' 2>/dev/null || true)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we swallow the errors here? If listing fails (for example a permission problem) we skip the cleanup without noticing, and the failure comes later as HTTP_400_AlreadyStaged, which is harder to read. An empty repository already returns an empty list with exit code 0.

@kikoso kikoso left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution, @zarturod . RELEASING.md describes still the Sonatype staging and the manual promotion in Nexus (steps 3 and 4), could we update it as part of this PR? And just to confirm: once the manifest is uploaded the release goes out without any manual step, right? Until now we had mavenCentralAutomaticRelease=false, so this changes a little bit how we release.

This branch has not been deployed

No deployments
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.

3 participants