Skip to content

Publish package to the Maven Central Repository #37

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #37

name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
- name: Checkout
uses: actions/checkout@v2
- name: Set up setting.xml
uses: s4u/[email protected]
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
}]
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
server-id: ossrh
- name: Publish package
run: mvn --batch-mode deploy -Pdeploy