[CI] Release workflow: publish to Maven Central from GitHub Actions - #33
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PetrHeinz
had a problem deploying
to
maven-central
September 25, 2026 14:52 — with
GitHub Actions
Failure
The first push-triggered dry run on this branch published 0.3.7 to Maven Central instead of stopping at validated: the <autoPublish>true</autoPublish> literal in the plugin configuration overrode the -DautoPublish=false flag. This is the version commit that run would have made; the published pom is this pom.xml at this commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ploading Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch was successfully deployed
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.
Adds
.github/workflows/release.yml, the counterpart of the Release workflows in logtail-js and logtail-python: dispatch it frommainwithpatchorminor, approve themaven-centralenvironment prompt, and it bumps the version inpom.xmland the two example projects, builds, commitsvX.Y.Z, tags, pushes, deploys the signed bundle to the Central Portal, waits until the Portal reports it published and creates a GitHub release with generated notes.retryfinishes a release that failed after the version commit was pushed. The header comment in the file is the runbook.Maven Central has no trusted publishing, so unlike npm and PyPI the publish job reads real credentials: the Portal user token and the signing key live as secrets on the
maven-centralenvironment, and the job restores nothing from the Actions cache. Two plugin bumps in the pom make the runner flow work and are worth having anyway:maven-gpg-plugin3.0.1 → 3.2.8, which reads the passphrase from theMAVEN_GPG_PASSPHRASEenvironment variable thatactions/setup-javav6 hands it. Thegpg.passphraseproperty from the manual runbook still works, with a deprecation warning.central-publishing-maven-plugin0.6.0 → 0.11.0, withwaitUntil: publishedin its configuration:mvn deploynow returns only once the Portal has published the deployment (or after 30 minutes), so the workflow, and a manual release, get a real success signal instead of "go watch the Deployments page". It also bringsignorePublishedComponents, which is what makesretrysafe against Central's immutability: components the Portal already published are left out of the bundle rather than re-uploaded.The dry run is the part that proves the setup without publishing. It uploads a real deployment with auto-publish off, which the Portal validates like any other (credentials, every signature, the key on a keyserver, javadoc and sources jars, pom metadata) and then stops at
VALIDATED; the workflow reads the deployment id from the plugin output and drops it through the Publisher API'sDELETE /api/v1/publisher/deployment/<id>. Every push that touches the workflow file runs this dry run on its own branch, so this PR's checks are the rehearsal for the change it makes, before it reachesmain. A dry run can also be dispatched from any branch.Rehearsed locally with a throwaway key on JDK 21 (the JDK the last manual release was built with): the release profile with both plugin bumps produces the same bundle layout as 0.3.6 on repo1, signs with the passphrase from the environment, and
-DautoPublish=falsestops at validated even though the pom asks for published (the plugin downgrades it with a warning, by design). The bump step was exercised on clones at an untagged HEAD and atv0.3.6forpatch,minor,retryand dry run.What the first push on this branch taught: its dry run published 0.3.7 for real. The pom had
<autoPublish>true</autoPublish>as a literal in the plugin configuration, and a literal in a plugin configuration wins over a-Dflag, so-DautoPublish=falsewas ignored and the Portal auto-published a valid, signed build ofmainas it was (functionally 0.3.6, nothing had merged since) with this branch's pom. Central is immutable, so 0.3.7 stays. The second commit here,v0.3.7, is the version commit that run would have made, and its pom.xml is byte-for-byte the pom the Portal published, so the tagv0.3.7and its GitHub release can be created on it if you want the repo to account for the version; the third commit movesautoPublishinto a pom property that the flag can override, and adds a step that reads the effective pom and refuses to upload unless the plugin'sautoPublishisfalse. The dry run on the third push targets 0.3.8 and must end with the deployment dropped.Environment settings worth checking before the first real release: required reviewers on
maven-central(currently off), and the deployment branch policy left unrestricted, because the push-triggered dry runs come from feature branches; the "releases run from main only" check lives in the workflow. Not automated: the dependency snippet in the docs article, which still says 0.3.4, and the Notion runbook.🤖 Generated with Claude Code