Repository navigation
ci(publish): fail loudly on missing credentials, and pin the tag to the pom - #12
Conversation
…he pom The publish workflow has never actually published. Releases 1.1.0 and 1.2.0 reached Maven Central by hand: no v1.1.0 or v1.2.0 tags exist, the workflow last ran for v1.0.4 in August and that run failed, and none of the four secrets it needs are configured at repo or org level. Publishing by hand from whatever branch happened to be checked out is how main ended up behind Central, missing the getAssetHolders that 1.2.0 shipped. Four changes: * Check the four secrets up front and name the missing ones. Previously a missing GPG_PRIVATE_KEY surfaced as "gpg --batch --import" failing on empty input, which says nothing about the cause. Presence is tested with a length check, so no secret value is echoed, compared or logged. * Refuse to publish when the tag disagrees with the pom. The tag is only a label; the version that reaches Central comes from the pom, so v1.3.0 could silently publish 1.4.0. That ambiguity is what this repo just spent a release untangling. * Run the suite in the release build. A tag can point at any commit, including one that never went through a PR, so trusting build.yml to have covered it is not safe. The old comment justified skipping tests by "drifted/absent test sources", which is stale - 44 tests pass on main. * State in the job summary that a green run means staged, not live. autoPublish is false, so the deployment still has to be released in the Central portal, and a green check otherwise reads as "it is on Central" when it is not. Also adds workflow_dispatch so a release can be re-driven without cutting a new tag. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ret is set Two problems with the presence check this replaces. It rejected a legitimately unprotected key. A dedicated release key with no passphrase is a reasonable setup - once the private key lives in GitHub secrets, a passphrase stored beside it protects against very little - and requiring GPG_PASSPHRASE non-empty turned that setup into a failed release. More importantly, presence tells you nothing about correctness: a wrong passphrase passes a non-empty check and then fails part-way through the deploy. So the key now has to produce a real signature before anything is uploaded. That catches a wrong passphrase, a missing one, and a GPG_PRIVATE_KEY that imported nothing, and it reports which. Worth recording why this is trustworthy in CI but not locally: gpg-agent caches an unlocked key, so on a developer machine a signing test succeeds with ANY passphrase once the key has been unlocked - verified here, where "total-garbage-xyz" signed successfully until the agent cache was flushed. A fresh runner has no agent cache, so the test cannot be fooled that way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Pushed Two reasons. A presence check rejected a legitimately unprotected release key, and more importantly it proved nothing: a wrong passphrase passes a non-empty check and then fails part-way through the deploy. Found the hard way while writing a local passphrase checker for this repo's key. It reported CORRECT for a passphrase I knew was wrong, because All four secrets are now configured on this repo, so the next tag exercises the real path. |
The workflow has never published anything
Evidence, not inference:
v1.1.0orv1.2.0tags exist, yet both versions are on Maven Centralpublish.ymllast ran for v1.0.4 on 2026-08-01, and its most recent attempt failedtotal_count: 0; this repo is public, so org secrets would reach it if any existed)So 1.1.0 and 1.2.0 were published by hand. That is how
maindrifted behind Central and lostgetAssetHolders, which #10 just spent a merge reconciling.What changes
Fail loudly when credentials are missing. A missing
GPG_PRIVATE_KEYcurrently surfaces asgpg --batch --importfailing on empty input — a message that says nothing about the cause. The new preflight names exactly which secrets are absent and prints thegh secret setcommand. Presence is tested with a length check, so no secret value is ever echoed, compared, or written to the log.Refuse to publish when the tag disagrees with the pom. The tag is only a label; the version that reaches Central comes from the pom.
v1.3.0could silently publish1.4.0, or republish an existing version. That is precisely the ambiguity this repo just spent a release untangling, so it now fails instead of guessing.Run the suite in the release build. A tag can point at any commit, including one that never went through a PR, so trusting
build.ymlto have covered it is not safe. The old comment justified skipping tests with "drifted/absent test sources" — stale, since 44 tests pass onmain.Say that green means staged, not live.
autoPublishisfalsein the release profile, so a successful run leaves the deployment validated and staged in the Central portal, awaiting a manual release. A green check currently reads as "it is on Central" when it is not. The job summary now says so and gives the verification command.Plus
workflow_dispatch, so a release can be re-driven without cutting a new tag.Verified
Both guards were exercised against real inputs rather than eyeballed:
Still needs a maintainer
This makes the failure legible; it cannot make it go away. The four secrets have to be set by someone who holds them:
gh secret setprompts for the value, so nothing lands in shell history.Until then, tagging
v1.4.0fails at the preflight with a clear message instead of dying at the GPG import — which is the intended behaviour, not a regression.🤖 Generated with Claude Code