Skip to content

Commit

Permalink
github action mvn deploy (#68)
Browse files Browse the repository at this point in the history
* github action mvn deploy

* github action mvn deploy

* change mustache
  • Loading branch information
ezerozen authored Apr 30, 2024
1 parent 4856948 commit a61a2b1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish package to the Maven Central Repository

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '11'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_SIGNING_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Publish to Apache Maven Central
run: mvn clean deploy -Dmaven.test.skip
env:
MAVEN_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME}}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MVN_CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<goal>sign</goal>
</goals>
<configuration>
<keyname>0x5F8EB601</keyname>
<keyname>A26C6169</keyname>
<passphraseServerId />
</configuration>
</execution>
Expand Down
2 changes: 1 addition & 1 deletion templates/java/jersey2/pom.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
<goal>sign</goal>
</goals>
<configuration>
<keyname>0x5F8EB601</keyname>
<keyname>A26C6169</keyname>
<passphraseServerId />
</configuration>
</execution>
Expand Down

0 comments on commit a61a2b1

Please sign in to comment.