Skip to content

v1.0.1

v1.0.1 #3

# This workflow will build a package using Maven and then publish it to Maven Central when a release is created
# For more information see: https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven
name: Maven Publish Release - Maven Central
on:
release:
types:
- created
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21 - Maven Central
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to Maven Central
run: mvn -B deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}