Skip to content

Commit a9dd808

Browse files
committed
publish fixes++++
1 parent 122cb62 commit a9dd808

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ jobs:
6060
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
6161
gpgconf --kill gpg-agent || true
6262
63+
- name: Detect GPG fingerprint
64+
id: gpg
65+
run: |
66+
FPR=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr:/ {print $10; exit}')
67+
if [ -z "$FPR" ]; then echo "No GPG secret key found" >&2; exit 1; fi
68+
echo "fingerprint=$FPR" >> "$GITHUB_OUTPUT"
69+
echo "Using GPG fingerprint ${FPR}"
70+
6371
- name: Set project version from tag
6472
run: |
6573
mvn -q -B versions:set -DnewVersion=${{ steps.vars.outputs.version }} -DgenerateBackupPoms=false
@@ -71,4 +79,4 @@ jobs:
7179
GPG_TTY: $(tty)
7280
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
7381
run: |
74-
mvn -B -s $GITHUB_WORKSPACE/maven-settings.xml -P release -DskipTests -Dgpg.passphrase=$GPG_PASSPHRASE clean verify central-publishing:publish
82+
mvn -B -s $GITHUB_WORKSPACE/maven-settings.xml -P release -DskipTests -Dgpg.passphrase=$GPG_PASSPHRASE -Dgpg.keyname=${{ steps.gpg.outputs.fingerprint }} clean verify central-publishing:publish

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ The `Release` workflow will:
154154

155155
Troubleshooting
156156
- If you see `base64: invalid input` or `gpg: no valid OpenPGP data found`, paste the ASCII‑armored private key directly into the `GPG_PRIVATE_KEY` secret (not base64). The workflow auto‑detects and imports either format.
157+
- If Central reports invalid signature or cannot find your public key by fingerprint:
158+
- Upload your public key to a supported keyserver, e.g. `keys.openpgp.org`, and verify the email identity used for the key (you will receive a verification email).
159+
- Alternatively, add the same public key in the Sonatype Central portal under your account’s PGP keys.
160+
- Make sure the key fingerprint in CI matches the one you uploaded (the workflow prints it during release).
157161

158162

159163
License

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
<artifactId>maven-gpg-plugin</artifactId>
130130
<version>3.2.4</version>
131131
<configuration>
132+
<keyname>${gpg.keyname}</keyname>
132133
<gpgArguments>
133134
<arg>--pinentry-mode</arg>
134135
<arg>loopback</arg>

0 commit comments

Comments
 (0)