Skip to content

Release artifact to Maven Central Repository #6

Release artifact to Maven Central Repository

Release artifact to Maven Central Repository #6

Workflow file for this run

name: Release artifact to Maven Central Repository
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Release version"
required: true
default: "X.Y.Z"
developmentVersion:
description: "Next snapshot version"
required: true
default: "X.Y.Z-SNAPSHOT"
jobs:
release:
name: Release to Maven Central
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Run Tests
run: mvn clean verify
- name: Maven Deploy
run: mvn clean deploy -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}