release-to-maven-central #5
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: release-to-maven-central | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseversion: | |
description: 'Release version' | |
required: true | |
default: '' | |
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: s01.oss.sonatype.org | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Set projects Maven version to GitHub Action GUI set version | |
run: mvn --batch-mode versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" | |
- name: Publish package | |
run: mvn --batch-mode clean deploy -P central-deploy -DskipTests=true | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |