Skip to content

ci: migrate mavencentral release publishing to OSS Exit Gate - #3174

Merged
eamonnmcmanus merged 2 commits into
google:mainfrom
alonsopf89:oss-exit-gate-mavencentral-migration
Nov 19, 2026
Merged

eamonnmcmanus merged 2 commits into
google:mainfrom
alonsopf89:oss-exit-gate-mavencentral-migration

Conversation

@alonsopf89

@alonsopf89 alonsopf89 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Configures Maven profiles (oss-exit-gate and bypass-oss-exit-gate) in pom.xml and gson/pom.xml along with release instructions in ReleaseProcess.md so Google maintainers can stage GPG-signed gson-parent and gson releases to Maven Central through Google's OSS Exit Gate (artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/gson--mavencentral), matching the approach adopted in google/guava#8843.

Details

  • Preserves local GPG-signed mvn release:perform flow: Reverts the .github/workflows/build.yml tag job since Gson cuts GPG-signed releases locally via mvn release:prepare / mvn release:perform (ReleaseProcess.md).
  • Safe transition via bypass-oss-exit-gate: Keeps central-publishing-maven-plugin active by default (-Dbypass-oss-exit-gate unset / !false) until one-time OSS Exit Gate credential handoff is finalized, while mvn release:perform -Darguments="-Dbypass-oss-exit-gate=false" switches deployment to artifactregistry-maven-wagon (https://us-maven.pkg.dev/oss-exit-gate-prod/gson--mavencentral) for gson-parent and gson only (keeping maven-deploy-plugin skipped on all test/internal submodules).

@google-cla

google-cla Bot commented Nov 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@eamonnmcmanus

Copy link
Copy Markdown
Member

Thanks for this! We do need the Google CLA to be signed (for this project, even if you have already signed it for other Google projects).

@Marcono1234 Marcono1234 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hopefully these comments here are useful, and not disruptive (otherwise please let me know).

Note that I am not a direct project member (so I don't know if there have been internal discussions about this already; nor can I see that referenced Buganizer issue I think), so feel free to consider these comments only as suggestions.

Out of curiosity, would it be necessary to remove central-publishing-maven-plugin then (possibly in a follow-up PR)? But that will then not suppress maven-deploy-plugin anymore I think; will that be an issue? Or how will the release workflow look like?
(But maybe that is not relevant for the public / me, if you internally are aware of the needed steps.)

Comment thread .github/workflows/build.yml Outdated
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'

@Marcono1234 Marcono1234 Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is cache: 'maven' here a good idea? I think https://docs.zizmor.sh/audits/#cache-poisoning generally discourages that for release workflows.

Comment thread .github/workflows/build.yml Outdated
cat > /tmp/settings.xml <<EOF
<settings>
<servers>
<server>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this also specify the recently added repositoryOrigins to be future-proof?

Comment thread .github/workflows/build.yml Outdated
TAG_NAME: ${{ github.ref_name }}
ACCESS_TOKEN: ${{ steps.auth.outputs.access_token }}
run: |
VERSION="${TAG_NAME#v}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the way VERSION is determined really correct? Gson's tag format is currently gson-parent-<version>.

Comment thread .github/workflows/build.yml Outdated
Comment on lines +122 to +124
oss-exit-gate-release:
name: Publish to Maven Central via OSS Exit Gate
if: startsWith(github.ref, 'refs/tags/')

@Marcono1234 Marcono1234 Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be cleaner to have a dedicated workflow file for this (with on: push: tags: ...)?

That might make it easier to read and reason about the behavior, and it is probably also cleaner in the GitHub UI. With the current approach this job here would appear for all non-release builds as skipped (can also be seen in the checks for this PR here).

@alonsopf89
alonsopf89 force-pushed the oss-exit-gate-mavencentral-migration branch from ad5f7ed to a51eb01 Compare November 17, 2026 15:31
@alonsopf89

Copy link
Copy Markdown
Contributor Author

Thanks @eamonnmcmanus! I've linked my GitHub account (alonsopf89) to my Google corporate email (fernandoalonso@google.com) in go/github and refreshed the commit — cla/google is now passing (SUCCESS). Ready whenever you'd like to merge!

@eamonnmcmanus eamonnmcmanus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you reply to the comments from @Marcono1234?

@alonsopf89

Copy link
Copy Markdown
Contributor Author

Thanks @Marcono1234 for the very helpful catches and @eamonnmcmanus for the review!

@Marcono1234's points highlighted that Gson (just like Guava) cuts GPG-signed releases locally via mvn release:prepare / mvn release:perform (ReleaseProcess.md) rather than from an unsigned GitHub Actions tag job — and that central-publishing-maven-plugin (<extensions>true</extensions>) suppresses maven-deploy-plugin unless scoped via Maven profiles.

I've updated the PR to follow the exact same Maven profile design we landed with @cpovirk in google/guava#8843:

  1. Reverted .github/workflows/build.yml cleanly back to main (eliminating the skipped CI job noise, cache: 'maven' in release context, settings.xml, and gson-parent-<version> tag parsing issues).
  2. Added oss-exit-gate and bypass-oss-exit-gate profiles in pom.xml and gson/pom.xml:
    • By default (bypass-oss-exit-gate != false), central-publishing-maven-plugin remains active exactly as today until one-time OSS Exit Gate credential handoff is complete.
    • Passing -Dbypass-oss-exit-gate=false (mvn release:perform -Darguments="-Dbypass-oss-exit-gate=false") deactivates central-publishing-maven-plugin, enables artifactregistry-maven-wagon (https://us-maven.pkg.dev/oss-exit-gate-prod/gson--mavencentral), and enables maven-deploy-plugin only on gson-parent (<inherited>false</inherited>) and gson (leaving test/internal modules skipped).
  3. Updated ReleaseProcess.md with the mvn release:perform -Darguments="-Dbypass-oss-exit-gate=false" and PublishingManifest (gson-parent + gson) GCS trigger commands.

All JDK 11–25, GraalVM, Android compatibility, reproducible build, CodeQL, and CLA checks are green!

@Marcono1234

Copy link
Copy Markdown
Contributor

Thanks for addressing my comments! From a quick look it seems this new approach integrates better with the existing release process. But I cannot say much more about it because I neither know the details about how OSS Exit Gate works nor how @eamonnmcmanus performed the releases in the past.

@eamonnmcmanus eamonnmcmanus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, thanks! I'll let you know if there are any problems the next time we make a release.

@eamonnmcmanus
eamonnmcmanus merged commit e5f02ab into google:main Nov 19, 2026
22 checks passed
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