Skip to content

Commit

Permalink
Add credentials to maven-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewKhouzam committed Mar 11, 2024
1 parent 2b1d458 commit ce3dea7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ jobs:
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
- name: Publish to Maven Central Repository
run: mvn --batch-mode deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
MAVEN_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}

0 comments on commit ce3dea7

Please sign in to comment.