ci: fix Maven GPG signing and crates.io idempotency for release#183
Merged
Conversation
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.
|
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.
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.
Fixes the two remaining blockers preventing a fully green
1.5.0-RC2release 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 bumpedcrazy-max/ghaction-import-gpgfrom v3 → v7. v3 configured a default signing key so a baregpg --detach-signworked (as in the RC1 release); v7 does not, so with a primary key + subkeys gpg can't auto-select.Fix: add
id: import_gpgand 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-key→gpg_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 publishfor 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 anycargo publishfailure 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-RC2tag 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, andcreate-github-releasefinally runs.