Skip to content

Publish package to the Maven Central Repository #3

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #3

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
server-id: ossrh
server-username: SONATYPE_USER
server-password: SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.SONATYPE_GPG_KEY }} # Value of the GPG private key to import
gpg-passphrase: SONATYPE_GPG_PASSWORD
- name: Publish package
run: mvn deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USER }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSWORD }}