Skip to content

Release to Maven Central #22

Release to Maven Central

Release to Maven Central #22

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