Skip to content

Release staged deployments to Maven Central automatically - #132

Merged
Vacxe merged 1 commit into
masterfrom
central-auto-release
Sep 4, 2026
Merged

Release staged deployments to Maven Central automatically#132
Vacxe merged 1 commit into
masterfrom
central-auto-release

Conversation

@Vacxe

@Vacxe Vacxe commented Sep 4, 2026

Copy link
Copy Markdown
Member

What changed

Adds one step to the shared release workflow (publish-release-workflow.yaml), right after the Gradle upload:

POST https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.github.kakaocup?publishing_type=automatic&deployment_name=<project>-<run number>

authenticated with the same SONATYPE_USERNAME / SONATYPE_PASSWORD secrets the upload uses.

Why

Tonight's "Publish All Libraries Release" run (#33818703554) was green, but nothing reached Maven Central and nothing appeared in the Central Portal. Gradle's built-in maven-publish plugin only performs Maven-style PUTs, which the OSSRH Staging API compatibility service collects into an implicit staging repository. Per Sonatype's docs for that service, maven-publish users must call the manual transfer endpoint afterwards or the deployment is never handed to the Portal:

https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#ensuring-deployment-visibility-in-the-central-publisher-portal

publishing_type=automatic additionally releases to Maven Central as soon as validation passes, so no Portal click is needed.

Reviewer notes

  • Same job, on purpose. The service resolves the default repository by namespace plus the client IP that uploaded. Each matrix job runs on its own runner, so the transfer has to happen inside that job. A separate trailing job would find nothing.
  • curl --fail-with-body makes the job fail visibly if the transfer or Portal validation is rejected, which the previous run lacked.
  • deployment_name is set to <project>-<run number> so the four parallel deployments are distinguishable in the Portal.
  • The four repositories left behind by tonight's run remain on the staging service under the CI account. They are harmless, but can be dropped later via DELETE /manual/drop/repository/<key> with that account's token.
  • After merging, re-run Publish All Libraries Release from master. 1.1.1 is not yet on Central, so re-uploading is safe.

🤖 Generated with Claude Code

Gradle's maven-publish upload only reaches the OSSRH Staging API compatibility
service; nothing transferred the deployment to the Central Portal, so releases
never became visible or published. Add a step after the upload that calls
/manual/upload/defaultRepository/io.github.kakaocup with
publishing_type=automatic, so each library is transferred and released once it
passes validation. It runs in the same job because the service resolves the
default repository by namespace and client IP.
@Vacxe
Vacxe merged commit 5f6371c into master Sep 4, 2026
3 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.

1 participant