Skip to content

Commit a77fde1

Browse files
committed
fix(ci): Provide GPG passphrase environment variable to setup-java
The MAVEN_GPG_PASSPHRASE environment variable must be available at the setup-java step level for GPG key import to work. Previously it was only set for the Maven publish step, causing "exit code 2" errors during both GPG import and cleanup. Also added diagnostic step to verify GPG key format.
1 parent f9b070d commit a77fde1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/maven-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
server-password: MAVEN_PASSWORD # env variable for token in deploy
3737
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} # Value of the GPG private key to import
3838
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
39+
env:
40+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
3941

4042
- name: Publish package
4143
run: mvn --no-transfer-progress --batch-mode -DperformRelease=true clean deploy

0 commit comments

Comments
 (0)