Skip to content

Publish package to the Maven Central Repository #9

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #9

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
check-release:
name: Reuse check release
uses: ./.github/workflows/check_release.yml
build:
name: Reuse build
uses: ./.github/workflows/build.yml
publish:
needs:
- build
- check-release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.SYSDEV_PRIVATE_GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: mvn clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.SYSDEV_PRIVATE_GPG_KEY_PASSPHRASE }}