Skip to content

Action for uploading lib to Maven Central - #24

Merged
fabiogouw merged 1 commit into
mainfrom
chore/maven-central-release
Jul 30, 2026
Merged

Action for uploading lib to Maven Central#24
fabiogouw merged 1 commit into
mainfrom
chore/maven-central-release

Conversation

@fabiogouw

@fabiogouw fabiogouw commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

This PR prepares spark-aws-messaging for Maven Central publication using Gradle and JReleaser.

What changed

  • configured the library module to stage Maven artifacts locally and deploy them through JReleaser
  • added a dedicated publishToMavenCentral task that chains staging and deployment
  • wired Maven Central credentials and GPG signing material through environment variables only
  • enabled JReleaser gitRootSearch and configured the com.fabiogouw namespace
  • removed the placeholder spark-aws-messaging/jreleaser.yml so the Gradle-based release configuration is the single source of truth
  • added a tag-driven GitHub Actions workflow for Maven Central upload
  • changed the GitHub Actions release flow to upload only, leaving final publication approval to the Maven Central Portal
  • simplified the existing CI workflow by removing obsolete OSSRH placeholder properties
  • documented the release flow in README.md

Local deployment

Before running a release locally, export these environment variables:

  • GITHUB_TOKEN
  • MAVEN_CENTRAL_USERNAME
  • MAVEN_CENTRAL_PASSWORD
  • JRELEASER_GPG_SECRET_KEY
  • JRELEASER_GPG_PASSPHRASE

Then run:

./gradlew :spark-aws-messaging:publishToMavenCentral

Useful validation commands:

./gradlew :spark-aws-messaging:jreleaserConfig
./gradlew :spark-aws-messaging:publishAllPublicationsToStagingRepository

If you want a two-step flow with manual confirmation in the Central Portal, use upload-only mode:

JRELEASER_MAVENCENTRAL_STAGE=UPLOAD ./gradlew :spark-aws-messaging:publishToMavenCentral

After the upload, review the deployment in the Maven Central Portal and confirm publication there.

GitHub Actions deployment

The release workflow is triggered by pushing a tag that matches v*.

Required GitHub Actions secrets:

  • MAVEN_CENTRAL_USERNAME
  • MAVEN_CENTRAL_PASSWORD
  • JRELEASER_GPG_SECRET_KEY
  • JRELEASER_GPG_PASSPHRASE

GITHUB_TOKEN is provided automatically by GitHub Actions.

Example release flow:

git tag v1.2.1
git push origin v1.2.1

The workflow uploads the deployment to Maven Central with JRELEASER_MAVENCENTRAL_STAGE=UPLOAD and stores JReleaser metadata as a workflow artifact. Final publication must then be confirmed manually in the Maven Central Portal.

Notes

  • keep the Gradle version in spark-aws-messaging/build.gradle aligned with the Git tag
  • if Maven Central provides token-based publishing credentials, use that generated username/password pair in MAVEN_CENTRAL_USERNAME and MAVEN_CENTRAL_PASSWORD

@sonarqubecloud

Copy link
Copy Markdown

@fabiogouw
fabiogouw merged commit 0cf0dd9 into main Jul 30, 2026
3 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.

1 participant