Skip to content

Publish package to the Maven Central #15

Publish package to the Maven Central

Publish package to the Maven Central #15

Workflow file for this run

---
name: Publish package to the Maven Central
on:
push:
tags:
- release/*
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Maven Central Repository
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'adopt'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
run: mvn -DskipTests --no-transfer-progress --batch-mode deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}