Skip to content

Commit

Permalink
Add signing plugin with release profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Duckelekuuk committed Sep 1, 2023
1 parent f719c48 commit 886ea43
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
run: mvn -Drevision=${{ github.event.release.tag_name }} --batch-mode deploy
run: mvn -Drevision=${{ github.event.release.tag_name }} --batch-mode deploy -P release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down
32 changes: 31 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
</plugin>

</plugins>
</pluginManagement>

Expand Down Expand Up @@ -207,5 +206,36 @@
</plugin>

</plugins>

</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<!--Sign the components - this is required by maven central for releases -->
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 886ea43

Please sign in to comment.