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]
workflow_dispatch:
jobs:
pre-build:
uses:
./.github/workflows/build.yml
publish-release:
needs:
- pre-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
server-id: ossrh
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Publish package to Maven Central
run: mvn --batch-mode clean deploy -P release -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}