Skip to content

Publish package to the Maven Central Repository #17

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #17

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@v6
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v5
with:
java-version: "21"
distribution: "temurin"
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.REQSTOOL_PRIVATE_GPG_KEY }}
gpg-passphrase: REQSTOOL_PRIVATE_GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: mvn clean deploy
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
REQSTOOL_PRIVATE_GPG_PASSPHRASE: ${{ secrets.REQSTOOL_PRIVATE_GPG_KEY_PASSPHRASE }}