Skip to content

Build common release #8

Build common release

Build common release #8

name: Build common release
on:
workflow_dispatch:
inputs:
branch:
description: "Branch to release from ?"
required: true
default: "sprint"
release-version:
description: "Release version ?"
required: true
release-tag:
description: "Release tag ?"
required: true
development-version:
description: "Next Development version ?"
required: true
jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Git checkout to main branch # Releases are published on main branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up JDK and OSSRH auth / GPG signing
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
server-id: "central"
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.gpg_private_key }}
gpg-passphrase: SIGN_KEY_PASS
- name: git-config
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Perform maven release
run: >
mvn --batch-mode --no-transfer-progress -f ${{ github.workspace }}/pom.xml release:prepare release:perform
-DreleaseVersion=${{ github.event.inputs.release-version }}
-DdevelopmentVersion=${{ github.event.inputs.development-version }}
-Dtag=${{ github.event.inputs.release-tag }}
-Darguments="-DskipTests"
env:
SIGN_KEY_PASS: ${{ secrets.gpg_passphrase }}
CENTRAL_USERNAME: ${{ secrets.sonatype_username }}
CENTRAL_PASSWORD: ${{ secrets.sonatype_password }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.release-tag }}
draft: false
prerelease: false
generate_release_notes: false