Skip to content

ci: fix Maven GPG signing and crates.io idempotency for release#183

Merged
jadamcrain merged 2 commits into
mainfrom
fix/maven-v7-gpg-signing
May 28, 2026
Merged

ci: fix Maven GPG signing and crates.io idempotency for release#183
jadamcrain merged 2 commits into
mainfrom
fix/maven-v7-gpg-signing

Conversation

@jadamcrain
Copy link
Copy Markdown
Member

@jadamcrain jadamcrain commented May 28, 2026

Fixes the two remaining blockers preventing a fully green 1.5.0-RC2 release run.

1. Maven GPG signing (release-maven)

The deploy step failed with gpg: signing failed: No secret key, even though the Import PGP key step succeeded (secret keys imported: 1). Root cause: #177 incidentally bumped crazy-max/ghaction-import-gpg from v3 → v7. v3 configured a default signing key so a bare gpg --detach-sign worked (as in the RC1 release); v7 does not, so with a primary key + subkeys gpg can't auto-select.

Fix: add id: import_gpg and pass --local-user ${{ steps.import_gpg.outputs.fingerprint }} to the signing calls (the action's recommended way to select the key).

(#182 earlier fixed the v7 input rename gpg-private-keygpg_private_key, which was the import failure; this fixes the signing failure that surfaced once import worked.)

2. crates.io idempotency (release-crates-io)

The job hard-failed running cargo publish for a version already on crates.io. The old existence probe queried the crates.io web API with curl's default User-Agent, which is rejected (403), so it fell through and published unconditionally.

Fix: check the sparse index (index.crates.io, the same source cargo reads) instead. On a match we skip; otherwise any cargo publish failure is a genuine failure — no error-string parsing.

Verified locally against the live index: 1.5.0-RC2 (published) → match → skip; a nonexistent version → no match → publish.

After merge

Move the 1.5.0-RC2 tag to the merge commit and re-push to re-run. Expected: crates.io skips (already published), NuGet skip-duplicate, Maven signs + uploads, docs re-publish, and create-github-release finally runs.

ghaction-import-gpg v7 (bumped from v3 in #177) does not configure a
default signing key, so the bare 'gpg --detach-sign' in the Maven deploy
step failed with 'no default secret key: No secret key' even though the
secret key imported successfully.

Capture the import step's fingerprint output and pass it via --local-user,
which is the action's recommended way to select the key. Resolves the
release-maven failure for 1.5.0-RC2.
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

The old existence probe hit the crates.io web API with curl's default
User-Agent, which is rejected (403), so it fell through and ran cargo
publish unconditionally -- hard-failing the job when the version was
already published. Check the sparse index (index.crates.io) instead, the
same source cargo reads; on a match we skip, otherwise any cargo publish
failure is a genuine failure.
@jadamcrain jadamcrain changed the title ci: sign Maven artifacts with explicit GPG key fingerprint ci: fix Maven GPG signing and crates.io idempotency for release May 28, 2026
@jadamcrain jadamcrain merged commit cc3d32e into main May 28, 2026
29 checks passed
@jadamcrain jadamcrain deleted the fix/maven-v7-gpg-signing branch May 28, 2026 22:24
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