Skip to content

Publish package to the Maven Central Repository #44

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #44

name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build with Maven
run: mvn package
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: GPG_KEY
gpg-passphrase: GPG_PASS
- name: Publish package
run: mvn deploy -Pdeploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
GPG_PASS: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}