ci: diagnose signing secret + sign with useInMemoryPgpKeys - #24
Merged
Merged
Conversation
Gradle's signing plugin expects signing.secretKeyRingFile to point at a binary GPG keyring, but SIGNING_PRIVATE_KEY_BASE64 decodes to an ASCII-armored key block, causing 'Unable to read secret key from file ... it may not be a PGP secret key ring' during signTestPublication. useInMemoryPgpKeys accepts the armored key text directly, sidestepping the binary-keyring requirement.
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
debug-signing-secret.ymlworkflow (workflow_dispatch) that reports whetherSIGNING_KEY_ID/SIGNING_KEY_PASSWORD/SIGNING_PRIVATE_KEY_BASE64are populated, the decoded byte length, and whether the decoded content looks like an ASCII-armored PGP key block — no key material is ever printed. Will be removed in a follow-up PR once we've confirmed what's going on.publishing-plugins/src/main/kotlin/mvn-publish.gradle.ktsto sign viasigning.useInMemoryPgpKeys(keyId, armoredKey, password)instead of writing the decoded secret to a binarysecretKeyRingFile. The latest1.7.2release attempt failed at:lib:signTestPublicationwithUnable to read secret key from file ... it may not be a PGP secret key ring— consistent withSIGNING_PRIVATE_KEY_BASE64decoding to an ASCII-armored key block rather than a binary keyring, which Gradle'ssecretKeyRingFilesignatory can't parse.useInMemoryPgpKeysaccepts the armored text directly.Test plan
maingh workflow run debug-signing-secret.ymland confirm the secret is populated and check its format1.7.2release (gh workflow run release.yml -f tag=1.7.2) and confirm signing succeedsdebug-signing-secret.ymlonce confirmed🤖 Generated with Claude Code