Publish package to Central #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish package to Central | |
on: | |
release: | |
types: [ created ] | |
workflow_dispatch: | |
concurrency: | |
group: | |
${{ github.repository }}-${{ github.workflow }}-${{ github.event.number || github.head_ref || github.run_id || github.sha }} | |
cancel-in-progress: true | |
env: | |
JAVA_VERSION: 8 | |
jobs: | |
publish-central: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} for publishing to Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: 'maven' | |
server-id: central | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Publish to the Maven Central Repository | |
run: ./mvnw clean --batch-mode -P default,central -Dpublish=central deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |