Skip to content

remiceres triggered Maven Central publish on v5.0.0 #6

remiceres triggered Maven Central publish on v5.0.0

remiceres triggered Maven Central publish on v5.0.0 #6

Workflow file for this run

name: Publish Maven Central
run-name: ${{ github.actor }} triggered Maven Central publish on ${{ github.event.inputs.ref || github.ref_name }}
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
ref:
description: "Branch, tag, or commit to publish (required)"
required: true
type: string
concurrency:
group: maven-central-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
release-maven-central:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref || github.ref }}
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "25"
cache: gradle
- name: Publish to Maven Central via Vanniktech
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
PROJECT_REF: ${{ github.event.inputs.ref || github.ref }}
run: |
version_arg=""
if [[ "$PROJECT_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ || "$PROJECT_REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version_arg="-PprojectVersion=$PROJECT_REF"
fi
./gradlew --no-daemon publishAllPublicationsToMavenCentralRepository ${version_arg}
- name: Manual release reminder
run: echo "Upload complete (no automatic release). Finalize deployment manually on https://central.sonatype.com/publishing/deployments"