Skip to content

Commit e764e0c

Browse files
committed
fix gpg signing in CI
1 parent 6f565de commit e764e0c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/publish-maven.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ jobs:
2222
server-id: central
2323
server-username: MAVEN_USERNAME
2424
server-password: MAVEN_PASSWORD
25-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
26-
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
25+
26+
- name: Import GPG key
27+
run: |
28+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
29+
gpg --list-secret-keys
2730
2831
- name: Set project version from tag
2932
run: |
@@ -37,3 +40,4 @@ jobs:
3740
env:
3841
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
3942
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
43+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@
136136
</execution>
137137
</executions>
138138
<configuration>
139+
<useAgent>false</useAgent>
140+
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
139141
<gpgArguments>
142+
<arg>--batch</arg>
140143
<arg>--pinentry-mode</arg>
141144
<arg>loopback</arg>
142145
</gpgArguments>

0 commit comments

Comments
 (0)