Skip to content

ci: write the release keyring to a fixed path and set up Java 11 - #287

Merged
mogita merged 1 commit into
mainfrom
ci/release-signing-keyring
Nov 16, 2026
Merged

mogita merged 1 commit into
mainfrom
ci/release-signing-keyring

Conversation

@mogita

@mogita mogita commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The release job reads the keyring path and the Sonatype staging profile ID from repo secrets, which have to go after the secret rotation, and neither value is a credential. The job also has no Java setup step, so it would run on the Java 25 that ubuntu-latest ships now, which Gradle 8.4 cannot run on.

Solution

  • Write the keyring to $RUNNER_TEMP/secring.gpg, outside the checkout, and pass that path to Gradle through GITHUB_ENV. The step no longer needs sudo.
  • Read SONATYPE_STAGING_PROFILE_ID from a variable. Only the Maven Central step uses it, and that step runs only when PUBLISH_TARGETS asks for Central.
  • Set up Java 11 the same way the Build workflow does.

How to verify

  1. A one-off branch run of these steps signs and stages the artifacts with the org GPG_KEY_CONTENTS. The link follows in a comment.
  2. After merge, delete the repo secrets SIGNING_SECRET_KEY_RING_FILE and SONATYPE_STAGING_PROFILE_ID.

Note

Medium Risk
Changes release signing and publish configuration; mistakes could break artifact signing or Maven Central uploads, but scope is limited to the release workflow.

Overview
Updates release CI so signed publishes run on a pinned JDK and rely less on repo secrets for non-sensitive config.

A new Set up Java 11 step (Corretto, same pattern as the build workflow) keeps Gradle 8.4 off the default newer JDK on ubuntu-latest.

Signing keyring handling now decodes GPG_KEY_CONTENTS into $RUNNER_TEMP/secring.gpg (outside the checkout), exports the path via GITHUB_ENV, and drops sudo plus the SIGNING_SECRET_KEY_RING_FILE secret from Gradle step env (Gradle still reads the variable from the environment).

Maven Central publish reads SONATYPE_STAGING_PROFILE_ID from repository variables instead of secrets.

Reviewed by Cursor Bugbot for commit e5b5b58. Bugbot is set up for automated code reviews on this repo. Configure here.

The keyring path and the Sonatype staging profile ID are not credentials, so they no longer come from repo secrets. The release job also sets up Java 11, because ubuntu-latest now ships Java 25, which Gradle 8.4 cannot run on.
@mogita

mogita commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

The Release job steps from this branch ran once on a throwaway branch: run 43872823685. With the org GPG_KEY_CONTENTS, SIGNING_KEY_ID and SIGNING_PASSWORD, Java 11 and the keyring in $RUNNER_TEMP, Gradle staged 1.51.0 under build/staged-repo with an .asc signature next to all 10 files. The signatures carry key ID CDED0C9A…, so the new key signed them and not the revoked 23FAA776A6D5DC9E. Nothing was uploaded, and the branch is deleted.

@mogita
mogita merged commit 1f7bbca into main Nov 16, 2026
6 checks passed
@mogita
mogita deleted the ci/release-signing-keyring branch November 16, 2026 13:18
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