Skip to content

ci(release): publish signed KMP artifact matrix to Maven Central - #20

Merged
octaviospain merged 2 commits into
cloudevents:mainfrom
octaviospain:12-maven-publishing-pipeline
Jul 21, 2026
Merged

ci(release): publish signed KMP artifact matrix to Maven Central#20
octaviospain merged 2 commits into
cloudevents:mainfrom
octaviospain:12-maven-publishing-pipeline

Conversation

@octaviospain

@octaviospain octaviospain commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Wires the Maven Central (Central Portal) publishing pipeline so io.cloudevents:cloudevents-kotlin-core can be released. The pipeline is fully configured but only runs when a release is cut, so this PR changes no build outputs on its own.

What changed

  • New cloudevents.publishing convention plugin (built on com.vanniktech.maven.publish) that publishes the full Kotlin Multiplatform artifact matrix — the root module plus one Maven module per target — to the Central Portal, with GPG signing and a complete POM (group io.cloudevents, artifact cloudevents-kotlin-core, Apache-2.0 license, SCM, developer, and organization metadata). Applied to the core module.
  • release.yml now runs on macos-latest. Kotlin/Native Apple targets can only be built on macOS, and a single macOS runner builds the entire matrix (JVM + JS + Wasm + all Apple + both Linux + mingw), so the complete signed set lands in one Central deployment. The job tags the release, publishes and auto-releases to Central (waiting for the deployment to be fully PUBLISHED before announcing), then generates the SBOM and cuts the GitHub release. The previous Linux job stopped at tagging and would have silently omitted the Apple targets.
  • Changelog-based release notes. A committed cliff.toml and the git-cliff action turn the Conventional Commit history since the previous tag into grouped release notes (Features, Bug Fixes, Build & CI, …) that become the GitHub release body.
  • Credentials are supplied only via CI as ORG_GRADLE_PROJECT_* environment variables and are never committed.
  • Dependency verification metadata regenerated for the publishing and signing dependencies. A few IDE-only artifacts (-sources.jar, -javadoc.jar, the org.apache.groovy:groovy distribution module, and the gradle:gradle source distribution) are trusted by name so an IntelliJ Gradle sync no longer fails verification for artifacts the command-line build never resolves.
  • Documentation: a new "Releasing" section in CONTRIBUTING.md covering the artifact matrix, local coordinate verification, the release process, and the required repository secrets.

Published artifact matrix

Maven coordinate Contents
io.cloudevents:cloudevents-kotlin-core Root module — Gradle module metadata + POM
…-core-jvm JVM jar
…-core-js JS klib
…-core-wasm-js Wasm-JS klib
…-core-linuxx64, …-core-linuxarm64 Linux native klibs
…-core-macosx64, …-core-macosarm64, …-core-iosarm64, …-core-iosx64, …-core-iossimulatorarm64 Apple native klibs
…-core-mingwx64 Windows native klib

Each module carries its own jar/klib, sources jar, javadoc jar, POM, and module metadata, and every file is GPG-signed.

Maintainer action required before a release can publish

Publishing to the io.cloudevents namespace needs repository secrets and namespace authorization that only the repo owners can provide:

Secret Purpose
MAVEN_CENTRAL_USERNAME / MAVEN_CENTRAL_PASSWORD Central Portal user-token credentials
SIGNING_KEY / SIGNING_PASSWORD ASCII-armored GPG private key + passphrase (public half on a keyserver)
SIGNING_KEY_ID Optional; only if the keyring holds more than one secret key

The Central Portal account behind the token must be authorized to publish to the io.cloudevents namespace.

Testing

  • gradle publishToMavenLocal produces correctly-coordinated artifacts (verified the JVM target and the root module: correct coordinates, complete POM, and valid Gradle module metadata listing every target variant).
  • Full Kotlin Multiplatform build passes with dependency verification enforced.
  • The build.yml dependency-metadata cross-check re-resolves byte-identical, so the integrity gate stays green.
  • Resolving sources jars under verification (previously the cause of IDE sync failures) now succeeds.

Closes #12

Summary by CodeRabbit

  • Build & Release Pipeline

    • Maven Central publishing now releases a complete, signed Kotlin Multiplatform artifact matrix to Central Portal and waits until deployment is fully published.
    • GitHub releases now include regenerated SBOMs tied to the released version and autogenerated release notes from Conventional Commits.
    • The changelog is regenerated during releases and pushed when it changes.
  • Documentation

    • Updated contributor guidance with expanded Central Portal release steps, artifact verification, and signing/CI requirements.
    • Added clearer supply-chain “trust rules” for IDE source/javadoc verification.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 845aa28a-5e73-43ac-ba32-38e7132d628e

📥 Commits

Reviewing files that changed from the base of the PR and between af07699 and c3f386f.

📒 Files selected for processing (10)
  • .github/workflows/release.yml
  • .gitignore
  • CONTRIBUTING.md
  • build-logic/convention/build.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.kmp-library.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.publishing.gradle.kts
  • cliff.toml
  • core/build.gradle.kts
  • gradle/libs.versions.toml
  • gradle/verification-metadata.xml
🚧 Files skipped from review as they are similar to previous changes (10)
  • core/build.gradle.kts
  • gradle/libs.versions.toml
  • build-logic/convention/build.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.publishing.gradle.kts
  • .gitignore
  • build-logic/convention/src/main/kotlin/cloudevents.kmp-library.gradle.kts
  • .github/workflows/release.yml
  • CONTRIBUTING.md
  • cliff.toml
  • gradle/verification-metadata.xml

📝 Walkthrough

Walkthrough

The PR adds signed Kotlin Multiplatform publication to Maven Central, moves release execution to macOS, wires CI credentials and signing, generates release notes and an SBOM, documents the release process, and updates Gradle dependency verification metadata.

Changes

Maven release pipeline

Layer / File(s) Summary
Publishing convention and module wiring
gradle/libs.versions.toml, build-logic/convention/..., core/build.gradle.kts
Adds the Maven Publish plugin and configures signed Central Portal publication with KMP coordinates and POM metadata.
Release workflow and operating instructions
.github/workflows/release.yml, CONTRIBUTING.md, cliff.toml, .gitignore
Runs publication on macOS, injects Central Portal and GPG credentials, generates release notes and changelogs, attaches an SBOM, and documents artifacts, local verification, release steps, and required secrets.
Dependency verification and trust rules
gradle/verification-metadata.xml, CONTRIBUTING.md
Adds trust rules and checksums for IDE artifacts, publishing dependencies, updated libraries, signing libraries, and Kotlin artifacts.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related issues

  • sdk-kotlin issue 15 — Shares updates to dependency verification metadata, SBOM release handling, and supply-chain documentation.

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant Gradle
  participant MavenCentral
  participant GitHubRelease
  GitHubActions->>Gradle: run publishAndReleaseToMavenCentral
  GitHubActions->>Gradle: provide Central Portal credentials and GPG key
  Gradle->>MavenCentral: upload signed KMP artifact matrix
  GitHubActions->>GitHubRelease: attach release notes and SBOM
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding signed KMP Maven Central publishing for releases.
Linked Issues check ✅ Passed The PR implements the Maven publishing plugin, GPG metadata, macOS release workflow, CI secrets, and docs required by #12.
Out of Scope Changes check ✅ Passed The changes shown are all tied to release publishing, release-note generation, or supporting dependency/docs updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@octaviospain octaviospain self-assigned this Jul 21, 2026
@octaviospain octaviospain added this to the 0.1.0 milestone Jul 21, 2026

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 52-64: Update the “Publish signed artifact matrix to Maven
Central” step’s Gradle command to set mavenCentralDeploymentValidation to
PUBLISHED, ensuring publishAndReleaseToMavenCentral waits until artifacts are
downloadable before the GitHub release proceeds.

In `@gradle/verification-metadata.xml`:
- Line 9: The org.apache.groovy trust rule is broader than the IDE-only
dependency set. In gradle/verification-metadata.xml at line 9, replace the
group-wide trust with entries for only the exact Groovy modules/files IntelliJ
resolves, and update CONTRIBUTING.md lines 352-358 to document the same scoped
artifacts and rationale.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab7b26c4-83d1-4028-9ba6-88d42e9037f3

📥 Commits

Reviewing files that changed from the base of the PR and between 05445cc and 9148a1e.

📒 Files selected for processing (8)
  • .github/workflows/release.yml
  • CONTRIBUTING.md
  • build-logic/convention/build.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.kmp-library.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.publishing.gradle.kts
  • core/build.gradle.kts
  • gradle/libs.versions.toml
  • gradle/verification-metadata.xml

Comment thread .github/workflows/release.yml Outdated
Comment thread gradle/verification-metadata.xml Outdated
@octaviospain
octaviospain force-pushed the 12-maven-publishing-pipeline branch 2 times, most recently from 9c0cbed to af07699 Compare July 21, 2026 12:38

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 104-113: Update the “Commit and push the changelog” step to detect
both modified and untracked CHANGELOG.md files before committing. Replace the
git diff-only condition with a git status --porcelain check scoped to
CHANGELOG.md, while preserving the existing git add, commit, and push flow.
- Line 113: Update the release workflow step containing the git push command so
github.ref_name is passed through an environment variable and referenced via the
shell’s environment expansion, rather than interpolated directly in run:.
Preserve the existing HEAD push target and configure the variable at the step
level.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 550388c5-f459-4bf7-a5c8-27792f9ba567

📥 Commits

Reviewing files that changed from the base of the PR and between 9c0cbed and af07699.

📒 Files selected for processing (10)
  • .github/workflows/release.yml
  • .gitignore
  • CONTRIBUTING.md
  • build-logic/convention/build.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.kmp-library.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.publishing.gradle.kts
  • cliff.toml
  • core/build.gradle.kts
  • gradle/libs.versions.toml
  • gradle/verification-metadata.xml
🚧 Files skipped from review as they are similar to previous changes (8)
  • build-logic/convention/src/main/kotlin/cloudevents.publishing.gradle.kts
  • build-logic/convention/src/main/kotlin/cloudevents.kmp-library.gradle.kts
  • core/build.gradle.kts
  • gradle/libs.versions.toml
  • cliff.toml
  • build-logic/convention/build.gradle.kts
  • CONTRIBUTING.md
  • gradle/verification-metadata.xml

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Add a cloudevents.publishing convention plugin (vanniktech) that publishes the full KMP
artifact matrix (root module plus one Maven module per target) to the Central Portal, with GPG
signing and a complete POM (io.cloudevents:cloudevents-kotlin-core, Apache-2.0, SCM, developer,
and organization metadata).

The release job runs on macos-latest so one runner builds the whole matrix (JVM, JS, Wasm,
Apple, Linux, mingw) into a single Central deployment. It tags, publishes and auto-releases,
waiting for the deployment to be fully PUBLISHED rather than only VALIDATED before announcing,
then generates the SBOM and cuts the GitHub release. Credentials come only from CI environment
variables and are never committed.

Regenerate gradle/verification-metadata.xml for the vanniktech and signing dependencies, and
trust IDE-only artifacts (sources/javadoc jars, org.apache.groovy:groovy, gradle:gradle) so an
IntelliJ sync no longer fails verification. Document the release path, required secrets, and the
IDE trust rules in CONTRIBUTING.

Closes cloudevents#12

Signed-off-by: Octavio Calleya Garcia <octavio@transgressoft.net>
Add a cliff.toml grouping the repository's Conventional Commits, and wire the git-cliff action
into the release workflow: it regenerates the cumulative CHANGELOG.md and commits it back to the
default branch after the release tag, and builds the GitHub release body from the tag's section.

SBOM generation runs before the changelog steps so the working tree is clean when axion-release
resolves the version, keeping the SBOM on the exact released version. The transient
RELEASE_NOTES.md is git-ignored; CHANGELOG.md is the committed artifact.

Detect the changelog with git status --porcelain so an untracked first-release CHANGELOG.md is
still committed, and pass github.ref_name through an env var to avoid run-step template injection.

Signed-off-by: Octavio Calleya Garcia <octavio@transgressoft.net>
@octaviospain
octaviospain force-pushed the 12-maven-publishing-pipeline branch from af07699 to c3f386f Compare July 21, 2026 13:05
@octaviospain
octaviospain merged commit 9bceb57 into cloudevents:main Jul 21, 2026
8 checks passed
@octaviospain
octaviospain deleted the 12-maven-publishing-pipeline branch July 21, 2026 13:13
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.

Maven publishing pipeline for releases

1 participant