Skip to content

Wire Gradle Plugin Portal publishing for clean 1.0.0 release#230

Merged
kirich1409 merged 2 commits into
mainfrom
chore/release-1.0.0-portal
Jun 1, 2026
Merged

Wire Gradle Plugin Portal publishing for clean 1.0.0 release#230
kirich1409 merged 2 commits into
mainfrom
chore/release-1.0.0-portal

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

Purpose

Bring the clean Gradle Plugin Portal publishing into the main release line so the 1.0.0 release publishes correctly:

  • Publish Gradle plugin to Plugin Portal, keep Central listing clean #228 (ported): Gradle plugin markers move off Maven Central to the Gradle Plugin Portal; Central carries only the clean dev.androidbroadcast.featured:featured-gradle-plugin.
  • CI: publish.yml gains a tag-only :featured-gradle-plugin:publishPlugins step so a tagged release actually lands the plugin (and its markers) on the Plugin Portal. Without it, removing markers from Central would make plugins { id(...) } unresolvable.

VERSION_NAME stays 1.0.0 (no SNAPSHOT bump pulled in). Closes #229.

After merge (release procedure)

  1. Re-tag v1.0.0 on the merged main HEAD (the existing tag predates these changes) and push → triggers publish.yml:
    • Maven Central: staged for manual promotion (existing behavior).
    • Gradle Plugin Portal: publishPlugins uploads directly (live; subject to first-time namespace approval for dev.androidbroadcast).
  2. Promote the Central deployment in the Portal UI.
  3. Verify plugins { id("dev.androidbroadcast.featured") version "1.0.0" } resolves via the default gradlePluginPortal(), and the Central listing shows a single featured-gradle-plugin artifact (no *.gradle.plugin markers).

Portal credentials GRADLE_PUBLISH_KEY / GRADLE_PUBLISH_SECRET are present in the Main environment.

🤖 Generated with Claude Code

kirich1409 and others added 2 commits June 1, 2026 10:54
)

Apply com.gradle.plugin-publish so the two java-gradle-plugin marker
artifacts (incl. the second groupId) are hosted on the Gradle Plugin
Portal via publishPlugins. Disable the marker -> Maven Central tasks so
the Central listing carries only the clean featured-gradle-plugin impl
jar (+ sources/javadoc/pom).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 1, 2026 07:58
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Configure Gradle Plugin Portal publishing for 1.0.0 release

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Configure Gradle Plugin Portal publishing for plugin markers
• Disable marker artifacts from Maven Central to keep listing clean
• Add plugin metadata (display name, description, tags, website)
• Add CI step to publish plugins on tagged releases only
Diagram
flowchart LR
  A["Gradle Plugin Portal<br/>Plugin Publish Plugin"] -->|"publishPlugins task"| B["Plugin Markers<br/>+ Implementation JAR"]
  C["Maven Central<br/>Maven Publish Plugin"] -->|"Filtered tasks"| D["Implementation JAR<br/>Only"]
  E["CI Workflow<br/>publish.yml"] -->|"Tag-only step"| A
  E -->|"Existing step"| C

Loading

Grey Divider

File Changes

1. featured-gradle-plugin/build.gradle.kts ⚙️ Configuration changes +32/-0

Configure plugin metadata and Portal publishing

• Added com.gradle.plugin-publish plugin for Portal publishing
• Configured plugin metadata (display names, descriptions, tags, website/VCS URLs)
• Disabled marker artifact publishing to Maven Central via task filtering
• Added detailed comments explaining marker artifact routing strategy

featured-gradle-plugin/build.gradle.kts


2. .github/workflows/publish.yml ⚙️ Configuration changes +10/-0

Add Portal publishing step to CI workflow

• Added new publishPlugins step that runs only on tagged releases
• Step publishes to Gradle Plugin Portal using Portal credentials
• Maintains existing Maven Central publishing in separate step
• Both steps use --no-configuration-cache for debuggability

.github/workflows/publish.yml


3. gradle/libs.versions.toml Dependencies +2/-0

Add Gradle plugin-publish dependency

• Added pluginPublish version constraint (2.1.1)
• Added pluginPublish plugin alias referencing com.gradle.plugin-publish

gradle/libs.versions.toml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Jun 1, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Context used

Grey Divider


Action required

1. Portal creds not passed 🐞 Bug ☼ Reliability
Description
The new Plugin Portal publish step sets GRADLE_PUBLISH_KEY/SECRET as environment variables but does
not pass them into Gradle as project/system properties and there is no repo build logic that maps
these env vars into Gradle properties. As a result, the Gradle build won’t reliably receive publish
credentials and the portal publish can fail due to missing auth.
Code

.github/workflows/publish.yml[R59-63]

Evidence
The workflow step only exports the secrets as plain environment variables and does not pass them via
-P... or ORG_GRADLE_PROJECT_*, and the shared CI setup action contains no additional mapping
logic.

.github/workflows/publish.yml[43-63]
.github/actions/setup-build-env/action.yml[1-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow exports `GRADLE_PUBLISH_KEY` / `GRADLE_PUBLISH_SECRET` but does not pass them to Gradle as properties (the way other publishing creds are provided via `ORG_GRADLE_PROJECT_*`). There is also no composite action/build script that maps these env vars to Gradle properties, so `:featured-gradle-plugin:publishPlugins` can run without credentials.

## Issue Context
- Maven Central step uses `ORG_GRADLE_PROJECT_*` env vars, which Gradle automatically maps to project properties.
- Plugin Portal step currently only sets plain env vars.

## Fix Focus Areas
- .github/workflows/publish.yml[55-63]

## Suggested change
Update the step to pass the secrets explicitly to Gradle, e.g.

```yaml
- name: Publish plugin to Gradle Plugin Portal
 if: startsWith(github.ref, 'refs/tags/')
 env:
   ORG_GRADLE_PROJECT_VERSION_NAME: ${{ steps.version.outputs.VERSION_NAME }}
 run: |
   ./gradlew --no-daemon :featured-gradle-plugin:publishPlugins --no-configuration-cache \
     -Pgradle.publish.key='${{ secrets.GRADLE_PUBLISH_KEY }}' \
     -Pgradle.publish.secret='${{ secrets.GRADLE_PUBLISH_SECRET }}'
```

(Alternatively, write them to `~/.gradle/gradle.properties` in the job, but passing `-P` is simplest/explicit.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. VERSION_NAME override ignored 🐞 Bug ≡ Correctness
Description
The workflow computes a tag/SNAPSHOT VERSION_NAME and exports it as
ORG_GRADLE_PROJECT_VERSION_NAME, but the featured-gradle-plugin included build force-sets its
version from ../gradle.properties, overriding CI-provided VERSION_NAME. This can publish the
plugin with the gradle.properties version instead of the computed tag/SNAPSHOT version, creating
wrong-version releases and inconsistent artifacts.
Code

.github/workflows/publish.yml[R62-63]

Evidence
CI explicitly computes/exports VERSION_NAME, but the included build unconditionally resets
version from ../gradle.properties (which is currently pinned to 1.0.0), so the exported CI value
is overridden for the included build.

.github/workflows/publish.yml[30-63]
featured-gradle-plugin/settings.gradle.kts[38-58]
gradle.properties[38-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`featured-gradle-plugin/settings.gradle.kts` currently sets `project.version` from `../gradle.properties` unconditionally in `gradle.beforeProject { ... }`, which overrides `VERSION_NAME` provided via CI (`ORG_GRADLE_PROJECT_VERSION_NAME`). This defeats the workflow’s computed version for the included build.

## Issue Context
- CI computes `VERSION_NAME` from the tag name (or appends `-SNAPSHOT` on branch pushes).
- The included build hard-pins the version from `../gradle.properties` (`VERSION_NAME=1.0.0`), so CI overrides are ignored.

## Fix Focus Areas
- featured-gradle-plugin/settings.gradle.kts[38-58]
- gradle.properties[38-40]
- .github/workflows/publish.yml[30-63]

## Suggested change
In `featured-gradle-plugin/settings.gradle.kts`, resolve the version by preferring a Gradle property override, falling back to `../gradle.properties`:

```kotlin
gradle.beforeProject {
 val parentProps = Properties().apply {
   parentPropertiesText.orNull?.reader()?.use { load(it) }
 }

 // Prefer CI / command-line overrides
 val overriddenVersion = providers.gradleProperty("VERSION_NAME").orNull
 val fileVersion = parentProps.getProperty("VERSION_NAME")
 val resolvedVersion = overriddenVersion ?: fileVersion ?: "unspecified"

 // Don’t clobber existing overrides
 parentProps.forEach { key, value ->
   if (!extensions.extraProperties.has(key.toString())) {
     extensions.extraProperties[key.toString()] = value.toString()
   }
 }
 extensions.extraProperties["VERSION_NAME"] = resolvedVersion
 version = resolvedVersion
}
```

This keeps `gradle.properties` as the default source of truth while allowing CI/tag/SNAPSHOT overrides to actually take effect for the included build.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

Copy link
Copy Markdown

Copilot AI left a comment

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 wires Gradle Plugin Portal publishing into the main release pipeline so the dev.androidbroadcast.featured Gradle plugin (and its marker artifacts) are published correctly for the 1.0.0 release, while keeping Maven Central “clean” (impl artifact only).

Changes:

  • Add the com.gradle.plugin-publish plugin to the version catalog.
  • Configure featured-gradle-plugin with Plugin Portal metadata and disable only the marker → Maven Central publish tasks.
  • Update the release workflow to run :featured-gradle-plugin:publishPlugins on tag builds using Plugin Portal credentials.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
gradle/libs.versions.toml Adds the Plugin Publish plugin version and alias to the version catalog.
featured-gradle-plugin/build.gradle.kts Applies com.gradle.plugin-publish, sets Portal metadata, and disables marker publishing to Maven Central.
.github/workflows/publish.yml Adds a tag-only CI step to publish the plugin to the Gradle Plugin Portal.

Comment on lines +59 to +63
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ steps.version.outputs.VERSION_NAME }}
run: ./gradlew --no-daemon :featured-gradle-plugin:publishPlugins --no-configuration-cache
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Portal creds not passed 🐞 Bug ☼ Reliability

The new Plugin Portal publish step sets GRADLE_PUBLISH_KEY/SECRET as environment variables but does
not pass them into Gradle as project/system properties and there is no repo build logic that maps
these env vars into Gradle properties. As a result, the Gradle build won’t reliably receive publish
credentials and the portal publish can fail due to missing auth.
Agent Prompt
## Issue description
The workflow exports `GRADLE_PUBLISH_KEY` / `GRADLE_PUBLISH_SECRET` but does not pass them to Gradle as properties (the way other publishing creds are provided via `ORG_GRADLE_PROJECT_*`). There is also no composite action/build script that maps these env vars to Gradle properties, so `:featured-gradle-plugin:publishPlugins` can run without credentials.

## Issue Context
- Maven Central step uses `ORG_GRADLE_PROJECT_*` env vars, which Gradle automatically maps to project properties.
- Plugin Portal step currently only sets plain env vars.

## Fix Focus Areas
- .github/workflows/publish.yml[55-63]

## Suggested change
Update the step to pass the secrets explicitly to Gradle, e.g.

```yaml
- name: Publish plugin to Gradle Plugin Portal
  if: startsWith(github.ref, 'refs/tags/')
  env:
    ORG_GRADLE_PROJECT_VERSION_NAME: ${{ steps.version.outputs.VERSION_NAME }}
  run: |
    ./gradlew --no-daemon :featured-gradle-plugin:publishPlugins --no-configuration-cache \
      -Pgradle.publish.key='${{ secrets.GRADLE_PUBLISH_KEY }}' \
      -Pgradle.publish.secret='${{ secrets.GRADLE_PUBLISH_SECRET }}'
```

(Alternatively, write them to `~/.gradle/gradle.properties` in the job, but passing `-P` is simplest/explicit.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +62 to +63
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ steps.version.outputs.VERSION_NAME }}
run: ./gradlew --no-daemon :featured-gradle-plugin:publishPlugins --no-configuration-cache
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Version_name override ignored 🐞 Bug ≡ Correctness

The workflow computes a tag/SNAPSHOT VERSION_NAME and exports it as
ORG_GRADLE_PROJECT_VERSION_NAME, but the featured-gradle-plugin included build force-sets its
version from ../gradle.properties, overriding CI-provided VERSION_NAME. This can publish the
plugin with the gradle.properties version instead of the computed tag/SNAPSHOT version, creating
wrong-version releases and inconsistent artifacts.
Agent Prompt
## Issue description
`featured-gradle-plugin/settings.gradle.kts` currently sets `project.version` from `../gradle.properties` unconditionally in `gradle.beforeProject { ... }`, which overrides `VERSION_NAME` provided via CI (`ORG_GRADLE_PROJECT_VERSION_NAME`). This defeats the workflow’s computed version for the included build.

## Issue Context
- CI computes `VERSION_NAME` from the tag name (or appends `-SNAPSHOT` on branch pushes).
- The included build hard-pins the version from `../gradle.properties` (`VERSION_NAME=1.0.0`), so CI overrides are ignored.

## Fix Focus Areas
- featured-gradle-plugin/settings.gradle.kts[38-58]
- gradle.properties[38-40]
- .github/workflows/publish.yml[30-63]

## Suggested change
In `featured-gradle-plugin/settings.gradle.kts`, resolve the version by preferring a Gradle property override, falling back to `../gradle.properties`:

```kotlin
gradle.beforeProject {
  val parentProps = Properties().apply {
    parentPropertiesText.orNull?.reader()?.use { load(it) }
  }

  // Prefer CI / command-line overrides
  val overriddenVersion = providers.gradleProperty("VERSION_NAME").orNull
  val fileVersion = parentProps.getProperty("VERSION_NAME")
  val resolvedVersion = overriddenVersion ?: fileVersion ?: "unspecified"

  // Don’t clobber existing overrides
  parentProps.forEach { key, value ->
    if (!extensions.extraProperties.has(key.toString())) {
      extensions.extraProperties[key.toString()] = value.toString()
    }
  }
  extensions.extraProperties["VERSION_NAME"] = resolvedVersion
  version = resolvedVersion
}
```

This keeps `gradle.properties` as the default source of truth while allowing CI/tag/SNAPSHOT overrides to actually take effect for the included build.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@kirich1409 kirich1409 merged commit fff11d5 into main Jun 1, 2026
10 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.

Wire Gradle Plugin Portal publishing before next release (publishPlugins + creds)

2 participants