Skip to content

Commit fee3b20

Browse files
committed
Add github-ossrh profile for gpg signing
1 parent 779b04d commit fee3b20

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/publish-ossrh.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2222
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2323
- name: Publish package
24-
run: ./mvnw --batch-mode deploy -DskipTests=true
24+
run: ./mvnw --batch-mode deploy -DskipTests=true -Pgithub-ossrh
2525
env:
2626
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
2727
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,35 @@
100100
</build>
101101
</profile>
102102

103+
<!-- This profile is activated by "publish-ossrh.yml" github action -->
104+
<profile>
105+
<id>github-ossrh</id>
106+
<build>
107+
<plugins>
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-gpg-plugin</artifactId>
111+
<executions>
112+
<execution>
113+
<id>sign-artifacts</id>
114+
<phase>verify</phase>
115+
<goals>
116+
<goal>sign</goal>
117+
</goals>
118+
<configuration>
119+
<!-- Prevent gpg from using pinentry programs -->
120+
<gpgArguments>
121+
<arg>--pinentry-mode</arg>
122+
<arg>loopback</arg>
123+
</gpgArguments>
124+
</configuration>
125+
</execution>
126+
</executions>
127+
</plugin>
128+
</plugins>
129+
</build>
130+
</profile>
131+
103132
<!-- This profile is used for generating docs that will be published on github -->
104133
<profile>
105134
<id>publish-doc</id>

0 commit comments

Comments
 (0)