ci: add Maven Central publish workflow + maintainer runbook (D4)#98
Merged
Conversation
Wires up Track D4 - the fourth and final step of the Maven Central pipeline. Fires on the same v* tag push that triggers the existing release.yml workflow. What the workflow does: 1. Re-runs mvnw verify against the tagged commit (defence-in-depth against a tag pushed from a broken branch). 2. actions/setup-java@v5 imports MAVEN_GPG_PRIVATE_KEY into the runner keyring and writes <server id='central'> credentials block from CENTRAL_USERNAME + CENTRAL_TOKEN secrets into ~/.m2/settings.xml. 3. Runs ./mvnw -P release -Dgpg.skip=false deploy. Release profile (D1) attaches sources + javadoc jars; maven-gpg-plugin (D2) signs them; central-publishing-maven-plugin (D3) uploads to Central and blocks until validation completes. Hyphenated tags (-rc, -alpha, -beta, -snapshot) are explicitly skipped via the job's if: guard. Those ship only to JitPack + the GitHub Release pre-release surface; Central rejects them anyway. workflow_dispatch input lets the maintainer re-publish an existing tag without re-cutting it if Central had a transient validator hiccup. Workflow is dormant until four GitHub repo secrets are wired by the maintainer: MAVEN_GPG_PRIVATE_KEY, MAVEN_GPG_PASSPHRASE, CENTRAL_USERNAME, CENTRAL_TOKEN. docs/contributing/release-process.md section 2.C walks through the one-time setup end-to-end. Stacked on D3 (#97). After D3 merges, this rebases fast-forward.
a6f3425 to
2c95119
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires up Track D4 — the fourth and final step of the Maven Central pipeline. Fires on the same
v*tag push that triggersrelease.yml.The workflow
.github/workflows/publish.yml:mvnw verifyat the tagged commit. Defence-in-depth against a tag pushed from a broken branch.actions/setup-java@v5configures GPG + Central credentials. ImportsMAVEN_GPG_PRIVATE_KEYinto the runner keyring; writes a<server id="central">credentials block fromCENTRAL_USERNAME+CENTRAL_TOKENinto~/.m2/settings.xml../mvnw -P release -Dgpg.skip=false deploy. Release profile (D1) attaches sources + javadoc jars;maven-gpg-plugin(D2) signs them;central-publishing-maven-plugin(D3) uploads to Central and blocks until validation completes.v1.7.0-rc.1,-alpha,-beta,-snapshot)if:guard skips it. Those ship to JitPack + GitHub Release pre-release only; Central rejects them.workflow_dispatchwithtaginputv1.6.6)autoPublish=falsein D3's plugin config means the artefact lands in Central's validation queue; maintainer releases it oncentral.sonatype.com.Documentation —
docs/contributing/release-process.mdTwo updates:
Workflow is dormant until secrets land
Four GitHub repo secrets the maintainer must wire (one-time):
MAVEN_GPG_PRIVATE_KEYMAVEN_GPG_PASSPHRASECENTRAL_USERNAMECENTRAL_TOKENThe full procedure (key generation, namespace verification, secret wiring) is in the new § 2.C of the release-process doc. Until those secrets are in place, the workflow will fail at the
Set up Temurin JDK 17 with Central credentialsstep with a clear "no key provided" error — no half-published state, no Central pollution.D-track final state
After this merges, the v1.6.6 cut is one human step away from publishing to Maven Central: wire the four secrets, cut the tag, watch
publish.ymlvalidate the upload, click the release-button oncentral.sonatype.com.autoPublish=falsekeeps the human in the loop for the first publish; flips totrueis a one-line follow-up once we're confident.Test plan
publish.ymlvalidates as YAMLrelease-process.mdguards green locallypublish.yml(~85 LOC) is the load-bearing piece; the docs are descriptive