Skip to content

Publish package to the Maven Central Repository #1

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #1

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
push:
tags:
- "*.*.*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to maven central
run: mvn -B -DskipTests=true --no-transfer-progress -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} -Prelease clean deploy
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USER }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PWD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }}
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
target/*.jar
target/*.jar.asc
licence.txt