Skip to content

Commit 4d283bd

Browse files
authored
Update maven-publish.yml
1 parent f933b2f commit 4d283bd

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/maven-publish.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2-
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3-
4-
name: Maven Package
1+
name: Maven Publish
52

63
on:
74
release:
@@ -22,15 +19,17 @@ jobs:
2219
with:
2320
java-version: '11'
2421
distribution: 'temurin'
25-
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
26-
settings-path: ${{ github.workspace }} # location for the settings.xml file
22+
server-id: central
23+
server-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
24+
server-password: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
25+
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
26+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
2727

2828
- name: Build with Maven
2929
run: mvn clean package -Dmaven.javadoc.skip=false
3030

31+
- name: Import signing key
32+
run: gpg --batch --import ${{ secrets.GPG_SECRET_KEY }}
33+
3134
- name: Publish to Maven Central
32-
run: mvn -X -s "$MAVEN_SETTINGS" deploy -DskipTests -Dmaven.javadoc.skip=false
33-
env:
34-
GITHUB_TOKEN: ${{ github.token }}
35-
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
36-
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
35+
run: mvn -X -Dgpg.passphrase=${{ secrets.PGP_PASSPHRASE }} deploy -DskipTests -Dmaven.javadoc.skip=false

0 commit comments

Comments
 (0)