Skip to content

build: dual-publish 2.10.0 to the Gradle Plugin Portal and Maven Central#295

Merged
tnj merged 2 commits into
masterfrom
feat/publish-to-gradle-plugin-portal
Jun 16, 2026
Merged

build: dual-publish 2.10.0 to the Gradle Plugin Portal and Maven Central#295
tnj merged 2 commits into
masterfrom
feat/publish-to-gradle-plugin-portal

Conversation

@tnj

@tnj tnj commented Jun 15, 2026

Copy link
Copy Markdown
Member

Overview

The legacy Sonatype OSSRH was sunset on 2025-06-30, so the old publish target now returns HTTP 402. This migrates 2.10.0 publishing to dual targets:

  • Gradle Plugin Portal (id com.deploygate) via com.gradle.plugin-publish
  • Maven Central (com.deploygate:gradle) via the OSSRH Staging API compatibility endpoint, finalized with a POST that transfers the deployment to the Central Portal

Changes

  • build.gradle: Add plugin-publish 2.1.1 (the 2.x line is required for the Gradle 9.x acceptance-matrix host) and a gradlePlugin {} block that registers only the namespaced com.deploygate id. The legacy bare deploygate id keeps working via the hand-written descriptor, shipped alongside the generated one. Point the publish URL at ossrh-staging-api.central.sonatype.com. Drop the explicit sources/javadoc artifacts from the release publication because plugin-publish already enables withSourcesJar()/withJavadocJar() on components.java.
  • release.sh: Run publishPlugins alongside the Maven publish, then issue the finalization POST (publishing_type=automatic) to release to Maven Central.
  • release.yml: Wire GRADLE_PORTAL_PUBLISH_KEY/SECRET and the Central Portal token; update the Slack message.
  • README: Lead with the plugins DSL (resolved from the Portal) and drop the now-unnecessary resolutionStrategy workaround; keep the legacy buildscript classpath path for back-compat.
  • UploadArtifactTask: Annotate the abstract inputParamsProvider getter with @Internal so validatePlugins (now wired into check by java-gradle-plugin) passes.

Local verification (wrapper 8.14.3 / JDK 17)

  • validatePlugins ✅ / publishToMavenLocal (release, pluginMaven, marker publications) ✅ / spotlessCheck
  • Full unit test suite: 135 passing (against the DeployGate mock server)
  • Confirmed the jar ships both deploygate.properties (legacy) and com.deploygate.properties (new)
  • Temporarily bumped the wrapper to 9.4.1: testPluginAcceptanceTest --dry-run succeeds → plugin-publish 2.1.1 configures on the Gradle 9.x acceptance-matrix rows

Post-merge steps

  1. Re-point git tag -f 2.10.0 onto the new HEAD and force-push to trigger release.yml
  2. GitHub Secrets are already registered (GRADLE_PORTAL_PUBLISH_KEY/SECRET, and SHARED_NEXUS_TOKEN_* updated with the Central token). The _TOKEN-less SHARED_NEXUS_USERNAME/PASSWORD are unreferenced and can be deleted.

🤖 Generated with Claude Code

The legacy Sonatype OSSRH was sunset on 2025-06-30, so the old publish
target returns HTTP 402. Migrate publishing to:

* Gradle Plugin Portal (id `com.deploygate`) via `com.gradle.plugin-publish`
* Maven Central (`com.deploygate:gradle`) via the OSSRH Staging API
  compatibility endpoint, finalized with a POST that transfers the
  deployment to the Central Portal.

Details:
- build.gradle: add the plugin-publish plugin (2.1.1, required for the
  Gradle 9.x acceptance-matrix host) and a `gradlePlugin {}` block that
  registers only the namespaced `com.deploygate` id. The legacy bare
  `deploygate` id keeps working via the hand-written descriptor shipped
  alongside the generated one. Point the publish URL at
  ossrh-staging-api.central.sonatype.com. Drop the explicit sources/javadoc
  artifacts from the `release` publication because plugin-publish already
  enables withSourcesJar()/withJavadocJar() on components.java.
- release.sh: run `publishPlugins` alongside the Maven publish, then POST
  the finalization request (publishing_type=automatic) to release to
  Maven Central.
- release.yml: wire GRADLE_PORTAL_PUBLISH_KEY/SECRET and the Central
  Portal token; update the Slack message.
- README: lead with the plugins DSL (resolved from the Portal) and drop
  the now-unnecessary resolutionStrategy workaround; keep the legacy
  buildscript classpath path for back-compat.
- UploadArtifactTask: annotate the abstract inputParamsProvider getter
  with @internal so validatePlugins (now wired into `check` by
  java-gradle-plugin) passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 15, 2026 09:15

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Gradle DeployGate plugin to support publishing to the Gradle Plugin Portal and transitions the Maven Central deployment to the new Sonatype Central Portal API. It also updates the README documentation to recommend the plugins DSL. A critical issue was identified in release.sh where the Authorization header incorrectly uses Bearer instead of Basic for Base64-encoded credentials, which will cause authentication to fail.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread release.sh

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the release pipeline for v2.10.0 to dual-publish the Gradle DeployGate plugin to both the Gradle Plugin Portal (com.deploygate) and Maven Central (com.deploygate:gradle), migrating away from the legacy OSSRH endpoint that is being sunset.

Changes:

  • Add com.gradle.plugin-publish configuration and Gradle Plugin Portal metadata, while keeping the legacy deploygate plugin ID working via the existing descriptor.
  • Update Maven publishing to use Central Portal’s OSSRH Staging API compatibility endpoint, and add a post-upload finalization call.
  • Wire new secrets into the release workflow and update README guidance to recommend the plugins {} DSL.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/groovy/com/deploygate/gradle/plugins/tasks/UploadArtifactTask.groovy Annotates an abstract task property to satisfy validatePlugins under plugin-publish/java-gradle-plugin.
release.sh Publishes to both destinations and finalizes the Central Portal staging upload.
README.md Recommends the plugins DSL via Plugin Portal and keeps legacy buildscript usage documented.
build.gradle Adds plugin-publish plugin and Gradle Plugin Portal metadata; updates Central publishing endpoint and removes duplicate sources/javadoc artifacts.
.github/workflows/release.yml Adds Plugin Portal credentials + Central finalization token env vars; updates Slack message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread release.sh
Comment thread release.sh Outdated
- Add `set -o pipefail` so a failure in the `printf | base64` pipeline that
  computes the auth token aborts the release (per Copilot review).
- Add a comment clarifying that the Central Portal Publisher API uses the
  Bearer scheme with a base64(user:pass) token (not HTTP Basic) — this is
  non-standard but documented, and was flagged by two automated reviewers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tnj tnj requested a review from satsukies June 15, 2026 13:01

@satsukies satsukies 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.

Thanks, LGTM

@tnj

tnj commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

ship it🚀

@tnj tnj merged commit 3a14913 into master Jun 16, 2026
24 checks passed
@tnj tnj deleted the feat/publish-to-gradle-plugin-portal branch June 16, 2026 01:45
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