Skip to content

Commit 886ea43

Browse files
committed
Add signing plugin with release profile
1 parent f719c48 commit 886ea43

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2020
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2121
- name: Publish package
22-
run: mvn -Drevision=${{ github.event.release.tag_name }} --batch-mode deploy
22+
run: mvn -Drevision=${{ github.event.release.tag_name }} --batch-mode deploy -P release
2323
env:
2424
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
2525
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

pom.xml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@
152152
<artifactId>maven-deploy-plugin</artifactId>
153153
<version>3.1.1</version>
154154
</plugin>
155-
156155
</plugins>
157156
</pluginManagement>
158157

@@ -207,5 +206,36 @@
207206
</plugin>
208207

209208
</plugins>
209+
210210
</build>
211+
212+
<profiles>
213+
<profile>
214+
<id>release</id>
215+
<build>
216+
<plugins>
217+
<!--Sign the components - this is required by maven central for releases -->
218+
<plugin>
219+
<artifactId>maven-gpg-plugin</artifactId>
220+
<version>3.1.0</version>
221+
<configuration>
222+
<gpgArguments>
223+
<arg>--pinentry-mode</arg>
224+
<arg>loopback</arg>
225+
</gpgArguments>
226+
</configuration>
227+
<executions>
228+
<execution>
229+
<id>sign-artifacts</id>
230+
<phase>verify</phase>
231+
<goals>
232+
<goal>sign</goal>
233+
</goals>
234+
</execution>
235+
</executions>
236+
</plugin>
237+
</plugins>
238+
</build>
239+
</profile>
240+
</profiles>
211241
</project>

0 commit comments

Comments
 (0)