Skip to content

Publish to Maven Central #6

Publish to Maven Central

Publish to Maven Central #6

Workflow file for this run

name: 'Publish to Maven Central'
on: workflow_dispatch
jobs:
publish:
name: 'Publish'
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-package: jdk
check-latest: true
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: GPG_KEY_PASSPHRASE
- name: 'Publish snapshot to OSSRH'
run: mvn --batch-mode -Possrh -DskipTests=true -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} release:prepare release:perform
env:
GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}