Release to Maven Central #22
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: 'X.X.X' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Apache Maven Central | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
server-id: central | |
server-username: ${{ secrets.OSSRH_USERNAME}} | |
server-password: ${{ secrets.OSSRH_PASSWORD }} | |
gpg-private-key: ${{ secrets.GPG_SIGN_KEY }} | |
gpg-passphrase: ${{ secrets.GPG_SIGN_PASSPHRASE }} | |
- name: Set projects Maven version to GitHub Action GUI set version | |
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" | |
- name: Build with Maven | |
run: | | |
mvn -B package --file pom.xml -DskipTests=true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to Apache Maven Central | |
run: mvn -B deploy -Psign --file pom.xml |