Skip to content

[maven-release-plugin] prepare release 1.7.0 #9

[maven-release-plugin] prepare release 1.7.0

[maven-release-plugin] prepare release 1.7.0 #9

Workflow file for this run

name: Publish Release to Maven Central
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-M[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-RC[0-9]+'
workflow_dispatch:
inputs:
tag:
description: 'Tag to checkout and publish (e.g., 2.0.0, 2.0.0-M1, 2.0.0-RC1)'
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: Validate tag format
run: |
TAG="${{ github.ref_name || inputs.tag }}"
if [[ ! "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-M[0-9]+|-RC[0-9]+)?$ ]]; then
echo "Error: Tag '$TAG' does not match valid version pattern"
echo "Expected formats: X.Y.Z, X.Y.Z-MN, or X.Y.Z-RCN"
exit 1
fi
echo "Tag '$TAG' is valid"
- 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 }}