ci: migrate publishing to Sonatype Central Portal (PER-9567)#18
Open
Shivanshu-07 wants to merge 1 commit into
Open
ci: migrate publishing to Sonatype Central Portal (PER-9567)#18Shivanshu-07 wants to merge 1 commit into
Shivanshu-07 wants to merge 1 commit into
Conversation
The release `Publish` workflow fails at `:initializeSonatypeStagingRepository` with HTTP 402 from https://oss.sonatype.org/service/local/ — the legacy OSSRH service was decommissioned (EOL 30 Jun 2025) and no longer creates staging repositories. The gradle-nexus.publish-plugin only speaks the old Nexus API and cannot target the new Central Portal. Switch to com.vanniktech.maven.publish (0.30.0), which publishes through the Central Portal by default and auto-releases the deployment, replacing the close-and-release Nexus step. Port the POM/coordinates/signing config from the removed scripts/publish-*.gradle into the espresso module, and update the workflow to a single publishToMavenCentral step with ORG_GRADLE_PROJECT_* env vars. Also bump checkout/setup-java to v4 to clear the Node 20 warnings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The release
Publishworkflow has been failing at the very first publish task (run):The build itself is fine —
assembleReleaseandandroidSourcesJarsucceed. The failure is the publish step:scripts/publish-root.gradleusesio.github.gradle-nexus.publish-pluginpointed at the legacy OSSRH endpointhttps://oss.sonatype.org/service/local/. Sonatype decommissioned legacy OSSRH (EOL 30 Jun 2025); the old Nexus no longer creates staging repositories, and the empty-body HTTP 402 is its shut-down signature. This is not a credentials/transient issue — every release will fail here until publishing moves to the Central Portal. Thegradle-nexus.publish-pluginonly speaks the old Nexus API and cannot target the Portal.This blocks the
v1.0.5-beta.0release.What
Migrate publishing to the Sonatype Central Portal via
com.vanniktech.maven.publish(0.30.0), the de-facto standard for Android libraries with first-class Portal support:build.gradle— replace the nexus plugin withcom.vanniktech.maven.publish; dropapply from: scripts/publish-root.gradle.espresso/build.gradle— apply the plugin and configuremavenPublishing { … }: coordinatesio.percy:espresso-java:1.0.5-beta.0, release AAR + sources + javadoc jars,publishToMavenCentral(true)(Central Portal default + auto-release),signAllPublications(), and the POM ported verbatim from the old script.scripts/publish-root.gradleandscripts/publish-module.gradle(fully superseded)..github/workflows/publish.yml— single./gradlew publishToMavenCentralstep usingORG_GRADLE_PROJECT_mavenCentral*/ORG_GRADLE_PROJECT_signingInMemory*env vars; auto-release replaces the oldcloseAndReleaseSonatypeStagingRepository. Bumpedactions/checkout/setup-javato v4 to clear Node 20 warnings.The artifact coordinates, POM metadata, and signing are preserved exactly; the published
io.percy:espresso-javaartifact is unchanged.This needs a Percy Sonatype Central Portal owner for the
io.percynamespace to:io.percynamespace is migrated/registered on central.sonatype.com.OSSRH_USERNAME/OSSRH_PASSWORDto the token values (theSIGNING_KEY*secrets stay as-is).SONATYPE_STAGING_PROFILE_IDis no longer used.Once the token is in place, re-run the
Publishworkflow (or re-cut thev1.0.5-beta.0release) to verify end-to-end.Testing notes
Gradle config could not be executed locally (no Android SDK + JDK 11 on hand); the DSL was validated against the plugin's current docs. CI exercises the real publish path once the Portal token above is provisioned.
🤖 Generated with Claude Code