Skip to content

Publish package to the Maven Central Repository #7

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #7

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4.0.0
with:
java-version: '17'
distribution: 'temurin'
server-id: central
server-username: ${{ secrets.CENTRAL_USERNAME }}
server-password: ${{ secrets.CENTRAL_PASSWORD }}
- name: Publish to the Maven Central Repository
run: mvn -s .github/maven/settings.xml --batch-mode clean deploy -DskipTests