Skip to content

Publish Release to Maven Central #7

Publish Release to Maven Central

Publish Release to Maven Central #7

Workflow file for this run

name: Publish Release to Maven Central
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to checkout and publish'
required: true
type: string
jobs:
release:
runs-on: ubuntu-20.04-self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ inputs.tag }}
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central
run: |
./mvnw -B clean deploy -PsonatypeRelease -DskipTests -pl '!jacoco-coverage-aggregate-report,!documentation'
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }}
MAVEN_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_GPG_PASSPHRASE }}