Publish to Maven Central Repository #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Maven Central Repository | |
on: workflow_dispatch | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install gpg secret key | |
run: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Set up maven settings | |
uses: s4u/[email protected] | |
with: | |
servers: | | |
[{ | |
"id": "ossrh", | |
"username": "${{ secrets.OSSRH_USERNAME }}", | |
"password": "${{ secrets.OSSRH_TOKEN }}" | |
}, | |
{ | |
"id": "gpg.passphrase", | |
"passphrase": "${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}", | |
"configuration": {} | |
}] | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Test user" | |
- name: Verify package | |
run: mvn --batch-mode verify | |
- name: Release package | |
run: mvn --batch-mode -DskipTests=true releaser:release |