Skip to content

Publish package to the Maven Central Repository #36

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #36

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}"
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh
server-username: ${{ secrets.OSS_SONATYPE_USERNAME }}
server-password: ${{ secrets.OSS_SONATYPE_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_SIGNING_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
- name: Publish package
run: mvn --batch-mode clean deploy -P mavenCentral -DskipTests=true
env:
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}