Skip to content

Add automated Maven Central publishing to release workflow - #100

Merged
jeremyprime merged 9 commits into
valkey-io:mainfrom
jeremyprime:feat/maven-publish-workflow
Aug 5, 2026
Merged

Add automated Maven Central publishing to release workflow#100
jeremyprime merged 9 commits into
valkey-io:mainfrom
jeremyprime:feat/maven-publish-workflow

Conversation

@jeremyprime

@jeremyprime jeremyprime commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a publish job to the release workflow that signs and deploys artifacts to Maven Central (staging) after the existing build/test/release steps complete.

Closes #85

Changes

  • New publish job gated by maven-publish environment approval
  • Uses OIDC to assume AWS IAM role (no static credentials in GitHub)
  • Fetches Maven and GPG credentials from AWS Secrets Manager
  • Configures GPG for non-interactive signing
  • Deploys spring-data-valkey and spring-boot-starter-data-valkey to Sonatype staging

Prerequisites

  • AWS IAM role with OIDC trust policy
  • Secrets in AWS Secrets Manager for Maven credentials and GPG key/passphrase
  • GitHub environment with required reviewers and AWS_ROLE_ARN variable

Testing

  • Tested by adding a temporary dry-run step to validate fetching and use of the Maven credentials and signing of the artifacts with a GPG private key

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
@jeremyprime
jeremyprime force-pushed the feat/maven-publish-workflow branch from d0b9c69 to 97c7e18 Compare July 29, 2026 22:00
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
@jeremyprime
jeremyprime deployed to maven-publish August 4, 2026 16:31 — with GitHub Actions Active
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
@jeremyprime
jeremyprime marked this pull request as ready for review August 4, 2026 16:48
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9216aa3e-3258-4424-8299-4caf7a54cf71

📥 Commits

Reviewing files that changed from the base of the PR and between 819d4c1 and 0b96c88.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The release workflow now defines a publishing job that retrieves AWS-managed credentials, imports a GPG signing key, deploys Valkey Maven modules to Maven Central, and removes an open staging repository when deployment fails.

Changes

Maven Central publishing

Layer / File(s) Summary
Publishing job and permissions
.github/workflows/release.yml
The workflow grants content and OIDC permissions. The dependent publish job configures Java, Maven caching, and publishing environment settings.
Credential and GPG setup
.github/workflows/release.yml
The job authenticates to AWS, retrieves and validates Maven and GPG credentials from Secrets Manager, exports them through GITHUB_ENV, and verifies the imported private key.
Deployment and staging cleanup
.github/workflows/release.yml
The job deploys signed Valkey modules to Maven Central with automatic release. On failure, it deletes the matching open Sonatype staging repository only when exactly one match exists.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant AWSSecretsManager
  participant GPG
  participant MavenCentral
  GitHubActions->>AWSSecretsManager: Retrieve Maven and GPG credentials
  AWSSecretsManager-->>GitHubActions: Return validated secrets
  GitHubActions->>GPG: Import and verify private key
  GitHubActions->>MavenCentral: Deploy signed Valkey modules
  MavenCentral-->>GitHubActions: Report deployment result
  GitHubActions->>MavenCentral: Delete the matching open staging repository after failure
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The workflow summary does not show checksum generation, bundle creation, or upload through the Sonatype Central Publisher API required by issue #85. Add checksum and bundle generation, upload the bundle through the Sonatype Central Publisher API, and verify the credential storage requirements from issue #85.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that the release workflow now automates Maven Central publishing.
Description check ✅ Passed The description accurately describes the new publishing job, authentication, credential retrieval, signing, and deployment changes.
Out of Scope Changes check ✅ Passed The changes are limited to release-workflow publishing, credential retrieval, GPG signing, and Maven deployment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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 195-202: Update the release workflow cleanup around REPOS and
REPO_KEY so it identifies the staging repository created by the current
deployment instead of blindly selecting .repositories[0]. Capture repository
keys before publishing and exclude them from cleanup, or reuse the staging
repository ID emitted by the publishing plugin, then delete only that matched
repository while preserving the existing drop request.
- Around line 102-103: Update the Checkout step using actions/checkout@v4 to
disable persisted credentials, and scope contents write permission only to the
specific job or step that requires publishing rather than the Maven steps.
Preserve checkout functionality while ensuring later Maven/plugin commands
cannot access the workflow token through Git.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b61fcc23-89c1-44e6-b1b3-7ff3789cab21

📥 Commits

Reviewing files that changed from the base of the PR and between a738816 and 819d4c1.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
@ikolomi

ikolomi commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

@jeremyprime did you migrated the creds from my AWS accout?

@jeremyprime

Copy link
Copy Markdown
Collaborator Author

@jeremyprime did you migrated the creds from my AWS accout?

Yes, I updated the existing spring-data-valkey-maven-token secret to use your working credentials.

The GitHub action assumes an IAM role which allows it to read that and other secrets (all in the Valkey Clients account) to perform the GPG signing and then publish to Maven Central.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
@jeremyprime
jeremyprime merged commit 4fa1bb0 into valkey-io:main Aug 5, 2026
24 checks passed
@jeremyprime
jeremyprime deleted the feat/maven-publish-workflow branch August 5, 2026 16:03
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.

Automate Maven Central publishing in release workflow

3 participants