Skip to content

Fix Maven Central publish for vespera-bridge + gradle plugin#134

Merged
owjs3901 merged 1 commit into
mainfrom
fix-maven-central-signing
May 26, 2026
Merged

Fix Maven Central publish for vespera-bridge + gradle plugin#134
owjs3901 merged 1 commit into
mainfrom
fix-maven-central-signing

Conversation

@owjs3901
Copy link
Copy Markdown
Contributor

Why

Run #26458007485 failed to publish vespera-bridge@0.1.0 and vespera-bridge-gradle-plugin@0.1.0 to Maven Central. Three independent regressions stacked together caused it:

1. shouldSign probed the wrong property → unsigned artifacts → Central Portal rejection

32b712a replaced the unconditional signAllPublications() call with:

val shouldSign = !providers.gradleProperty("signingInMemoryKeyId").orNull.isNullOrBlank()
        || !System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyId").isNullOrBlank()

mavenPublishing {
    publishToMavenCentral(automaticRelease = true)
    if (shouldSign) signAllPublications()
}

But CI.yml only sets:

  • ORG_GRADLE_PROJECT_mavenCentralUsername / Password
  • ORG_GRADLE_PROJECT_signingInMemoryKey ← the actual key
  • ORG_GRADLE_PROJECT_signingInMemoryKeyPassword

signingInMemoryKeyId is never set anywhere, so shouldSign evaluated to false and signAllPublications() was skipped. Central Portal received unsigned artifacts and rejected the deployment — the gradle log ends at Deployment is being validated and never progresses to is being published (the successful 0.0.14 log shows both lines).

Maven Central confirms 0.0.14 was the last published version.

2. Plugin's gradlew had no executable bit

The new libs/vespera-bridge-gradle-plugin directory was added by 32b712a but the workflow's chmod step still only touched libs/vespera-bridge/gradlew. changepacks runs ./gradlew publishToMavenCentral from each Java project's directory, so the plugin invocation failed immediately with no log output (the failing run's publish output for libs/vespera-bridge-gradle-plugin/build.gradle.kts: line is empty).

3. .changepacks/config.json didn't track the new plugin

Cargo-driven version bumps only bumped vespera-bridge, never the plugin. Future Cargo bumps would silently leave the plugin behind.

Changes

  • libs/vespera-bridge/build.gradle.kts, libs/vespera-bridge-gradle-plugin/build.gradle.kts — probe signingInMemoryKey (the actual key) instead of signingInMemoryKeyId.
  • .github/workflows/CI.ymlchmod +x both gradlew binaries.
  • libs/vespera-bridge*/gradlew — index filemode set to 100755 (defense-in-depth so the workflow chmod is no longer load-bearing on Linux runners).
  • .changepacks/config.jsonupdateOn now lists both Java packages.
  • .changepacks/changepack_log_*.json — Patch bump for both Java packages (Maven Central does not allow re-uploading the rejected 0.1.0, so this triggers an Update Versions PR for 0.1.1).

Verification plan

After merging this PR, the auto-generated Update Versions PR will bump bridge/plugin 0.1.0 → 0.1.1. When that PR merges, the CI publish step should now:

  1. chmod +x both gradlew binaries (defense; index already has 100755).
  2. Run ./gradlew publishToMavenCentral --stacktrace for both Java packages.
  3. shouldSign = truesignAllPublications() runs → signed artifacts → Central Portal validation passes → release.

Cargo 0.2.0 was already published successfully and stays unchanged.

Three independent bugs blocked the 0.1.0 publish run
(https://github.com/dev-five-git/vespera/actions/runs/26458007485):

1. `shouldSign` probed `signingInMemoryKeyId` instead of
   `signingInMemoryKey`.  CI only sets the latter (the actual PGP
   private key), so `shouldSign` evaluated to `false` and the
   `signAllPublications()` call was skipped, leaving unsigned
   artifacts that Maven Central's Central Portal rejected during
   validation (gradle log ended at `Deployment is being validated`
   instead of progressing to `is being published`).

2. `libs/vespera-bridge-gradle-plugin/gradlew` lacked the executable
   bit, and the workflow's chmod step only touched
   `libs/vespera-bridge/gradlew`.  changepacks invokes
   `./gradlew publishToMavenCentral` per package, so the plugin
   publish failed immediately with no log output.

3. `.changepacks/config.json` did not list the gradle plugin in
   `updateOn`, so future Cargo bumps would not auto-bump the
   plugin alongside vespera-bridge.

Fixes:
- Both `build.gradle.kts` now probe `signingInMemoryKey` (both as a
  Gradle property and as `ORG_GRADLE_PROJECT_signingInMemoryKey`
  env var).
- `CI.yml` chmods +x both gradlew binaries.
- Both gradlew files are also marked `100755` in the index so the
  chmod step is defense-in-depth.
- `.changepacks/config.json` updates both Java packages on Cargo
  changes.
- Added a Patch changepack to drive the 0.1.0 -> 0.1.1 republish
  (Maven Central does not allow re-uploading the rejected 0.1.0).
@github-actions
Copy link
Copy Markdown

Changepacks

vespera@0.2.0 - Cargo.toml

Maybe you forgot to write the following files to the latest version

vespera-bridge@0.1.0 → 0.1.1 - libs/vespera-bridge/build.gradle.kts

Patch

  • Fix Maven Central publish: probe signingInMemoryKey (the actual private key, which CI sets) instead of signingInMemoryKeyId (which CI does not set); also chmod +x both gradlew binaries

vespera-bridge-gradle-plugin@0.1.0 → 0.1.1 - libs/vespera-bridge-gradle-plugin/build.gradle.kts

Patch

  • Fix Maven Central publish: probe signingInMemoryKey (the actual private key, which CI sets) instead of signingInMemoryKeyId (which CI does not set); also chmod +x both gradlew binaries

@owjs3901 owjs3901 merged commit be06439 into main May 26, 2026
4 checks passed
@owjs3901 owjs3901 deleted the fix-maven-central-signing branch May 26, 2026 16:37
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