Skip to content

Publish to Maven Central Repository #10

Publish to Maven Central Repository

Publish to Maven Central Repository #10

Workflow file for this run

name: Publish to Maven Central Repository
on: workflow_dispatch
jobs:
publish:
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'
cache: 'maven'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "Github Action"
- run: echo "M2_HOME=$(dirname $(dirname `which mvn`))" >> $GITHUB_ENV
- name: Verify package
run: mvn --batch-mode verify
- name: Release package
run: mvn --batch-mode -DskipTests=true releaser:release
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
MAVEN_GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish documentation
run: mvn scm-publish:publish-scm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}