Skip to content

Commit a3e7b08

Browse files
committed
fix(java): add GPG signing for Maven Central deployment
1 parent 0297a8a commit a3e7b08

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ jobs:
316316
server-id: central
317317
server-username: MAVEN_USERNAME
318318
server-password: MAVEN_PASSWORD
319+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
320+
gpg-passphrase: GPG_PASSPHRASE
319321

320322
- name: Update version
321323
run: |
@@ -329,6 +331,7 @@ jobs:
329331
env:
330332
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
331333
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
334+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
332335

333336
# Publish to crates.io
334337
publish-crates:

libs/java/pom.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,20 @@
110110
<id>release</id>
111111
<build>
112112
<plugins>
113-
<!-- No GPG signing required for new Maven Central -->
113+
<plugin>
114+
<groupId>org.apache.maven.plugins</groupId>
115+
<artifactId>maven-gpg-plugin</artifactId>
116+
<version>3.1.0</version>
117+
<executions>
118+
<execution>
119+
<id>sign-artifacts</id>
120+
<phase>verify</phase>
121+
<goals>
122+
<goal>sign</goal>
123+
</goals>
124+
</execution>
125+
</executions>
126+
</plugin>
114127
</plugins>
115128
</build>
116129
</profile>

0 commit comments

Comments
 (0)