fix(release): supply Maven Central creds as ORG_GRADLE_PROJECT_ props (qs-04) - #44
Merged
Conversation
The vanniktech maven-publish plugin reads the Gradle properties `mavenCentralUsername`/`mavenCentralPassword`, which Gradle populates from the environment only when prefixed `ORG_GRADLE_PROJECT_`. release.yml exported the secrets as `MAVEN_CENTRAL_USERNAME`/`MAVEN_CENTRAL_PASSWORD`, so the plugin never saw them and the publish step failed with 'mavenCentralUsername not found'. Rename to the prefixed form (same convention the signing creds beside them already use); secret references unchanged. (qs-04.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
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.
Summary
After qs-02 (#41) and qs-03 (#43) merged, the
Releaseworkflow now runs cleanly through semantic-release into the Gradle Maven Central publish step — where it fails:Root cause: the vanniktech maven-publish plugin (
publishToMavenCentral()) reads the Gradle project propertiesmavenCentralUsername/mavenCentralPassword. Gradle populates a project property from the environment only when the env var is prefixedORG_GRADLE_PROJECT_.release.ymlexported the secrets under the wrong names (MAVEN_CENTRAL_USERNAME/MAVEN_CENTRAL_PASSWORD), so Gradle never surfaced them as those properties and the plugin reported them as not found.The signing credentials directly below them already use the correct convention (
ORG_GRADLE_PROJECT_signingInMemoryKey*) — the Maven Central credentials simply didn't follow the same pattern. This is a pre-existing Story-1.4 bug that only surfaced now that the pipeline reaches the publish step for the first time.Change
In the
Run semantic-releasestep'senv:block, rename the two keys to theORG_GRADLE_PROJECT_form the plugin expects (secret references unchanged):MAVEN_CENTRAL_USERNAME→ORG_GRADLE_PROJECT_mavenCentralUsernameMAVEN_CENTRAL_PASSWORD→ORG_GRADLE_PROJECT_mavenCentralPasswordThe adjacent comment is updated to note these are Gradle project properties consumed by the vanniktech plugin (same convention as the
ORG_GRADLE_PROJECT_signingInMemoryKey*lines). No other change — signing vars,GITHUB_TOKEN, permissions, the gradle command, andrelease.config.mjsare untouched.Verification
env:block now exportsORG_GRADLE_PROJECT_mavenCentralUsername/ORG_GRADLE_PROJECT_mavenCentralPasswordfrom the same secrets, and noMAVEN_CENTRAL_USERNAME/MAVEN_CENTRAL_PASSWORDkeys remain../gradlew :packages:sdk:publishToMavenLocal→BUILD SUCCESSFUL(AAR + sources + javadoc + complete POM).Releaserun after merge.Spec: qs-04 (
maven-central-credential-env-vars).🤖 Generated with Claude Code