Repository navigation
ci: migrate mavencentral release publishing to OSS Exit Gate - #3174
Conversation
|
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. |
|
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). |
There was a problem hiding this comment.
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.)
| with: | ||
| distribution: 'temurin' | ||
| java-version: '21' | ||
| cache: 'maven' |
There was a problem hiding this comment.
Is cache: 'maven' here a good idea? I think https://docs.zizmor.sh/audits/#cache-poisoning generally discourages that for release workflows.
| cat > /tmp/settings.xml <<EOF | ||
| <settings> | ||
| <servers> | ||
| <server> |
There was a problem hiding this comment.
Should this also specify the recently added repositoryOrigins to be future-proof?
| TAG_NAME: ${{ github.ref_name }} | ||
| ACCESS_TOKEN: ${{ steps.auth.outputs.access_token }} | ||
| run: | | ||
| VERSION="${TAG_NAME#v}" |
There was a problem hiding this comment.
Is the way VERSION is determined really correct? Gson's tag format is currently gson-parent-<version>.
| oss-exit-gate-release: | ||
| name: Publish to Maven Central via OSS Exit Gate | ||
| if: startsWith(github.ref, 'refs/tags/') |
There was a problem hiding this comment.
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).
ad5f7ed to
a51eb01
Compare
|
Thanks @eamonnmcmanus! I've linked my GitHub account ( |
eamonnmcmanus
left a comment
There was a problem hiding this comment.
Could you reply to the comments from @Marcono1234?
|
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 I've updated the PR to follow the exact same Maven profile design we landed with
All JDK 11–25, GraalVM, Android compatibility, reproducible build, CodeQL, and CLA checks are green! |
|
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
left a comment
There was a problem hiding this comment.
This is great, thanks! I'll let you know if there are any problems the next time we make a release.
Summary
Configures Maven profiles (
oss-exit-gateandbypass-oss-exit-gate) inpom.xmlandgson/pom.xmlalong with release instructions inReleaseProcess.mdso Google maintainers can stage GPG-signedgson-parentandgsonreleases to Maven Central through Google's OSS Exit Gate (artifactregistry://us-maven.pkg.dev/oss-exit-gate-prod/gson--mavencentral), matching the approach adopted ingoogle/guava#8843.Details
mvn release:performflow: Reverts the.github/workflows/build.ymltag job since Gson cuts GPG-signed releases locally viamvn release:prepare/mvn release:perform(ReleaseProcess.md).bypass-oss-exit-gate: Keepscentral-publishing-maven-pluginactive by default (-Dbypass-oss-exit-gateunset /!false) until one-time OSS Exit Gate credential handoff is finalized, whilemvn release:perform -Darguments="-Dbypass-oss-exit-gate=false"switches deployment toartifactregistry-maven-wagon(https://us-maven.pkg.dev/oss-exit-gate-prod/gson--mavencentral) forgson-parentandgsononly (keepingmaven-deploy-pluginskipped on all test/internal submodules).