Publish package to the Maven Central Repository #2
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 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: 17 | |
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 |