Skip to content

Commit bd2014b

Browse files
authored
Update maven-publish.yml
1 parent f0a6114 commit bd2014b

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/maven-publish.yml

+18-5
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,31 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v2
20-
- name: Set up JDK 8
20+
21+
- name: Set up Java for publishing to Maven Central Repository
22+
uses: actions/setup-java@v2
23+
with:
24+
java-version: '8'
25+
distribution: 'adopt'
26+
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
27+
server-username: MAVEN_USERNAME
28+
server-password: MAVEN_PASSWORD
29+
30+
- name: Publish to the Maven Central Repository
31+
run: mvn -P ossrh,sign -B deploy -s $GITHUB_WORKSPACE/settings.xml
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
35+
36+
- name: Set up Java for publishing to GitHub Packages
2137
uses: actions/setup-java@v2
2238
with:
2339
java-version: '8'
2440
distribution: 'adopt'
2541
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
2642
settings-path: ${{ github.workspace }} # location for the settings.xml file
2743

28-
- name: Build with Maven
29-
run: mvn -B package --file pom.xml
30-
3144
- name: Publish to GitHub Packages Apache Maven
32-
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
45+
run: mvn -P github -B deploy -s $GITHUB_WORKSPACE/settings.xml
3346
env:
3447
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)