Skip to content

Release

Release #6

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 1.0.0)'
required: true
type: string
next_version:
description: 'Next development version (e.g. 1.0.1-SNAPSHOT)'
required: true
type: string
env:
JAVA_VERSION: '21'
JAVA_DISTRO: 'temurin'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: 'maven'
- name: Set version
if: github.event_name == 'workflow_dispatch'
run: |
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.version }}
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add pom.xml
git commit -m "Release version ${{ github.event.inputs.version }}"
git tag -a "v${{ github.event.inputs.version }}" -m "Release version ${{ github.event.inputs.version }}"
git push origin master
git push origin "v${{ github.event.inputs.version }}"
- name: Release
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_MAVENCENTRAL_SONATYPE_TOKEN : ${{ secrets.SONATYPE_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
run: mvn -Prelease
- name: Set next version
if: github.event_name == 'workflow_dispatch'
run: |
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.next_version }}
git add pom.xml
git commit -m "Prepare for next development version"
git push origin master