Skip to content

Release

Release #18

Workflow file for this run

name: Release
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
jobs:
release:
runs-on: ubuntu-latest
environment: Maven Central Release
steps:
- uses: actions/checkout@v4
with:
# this is by default 1, but this is required
# to generate the changelog from commit messages
fetch-depth: 0
submodules: true
- uses: joshlong/java-version-export-github-action@v28
id: jve
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ steps.jve.outputs.java_major_version }}
cache: 'maven'
# add a commit with the new version:
- name: Version
id: vars
shell: bash
run: |
VERSION=${{ github.event.inputs.version }}
mvn -B versions:set versions:commit -DnewVersion=$VERSION
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Action"
git commit -a -m "release version v$VERSION"
git push origin main
- name: Deploy with Maven
run: mvn -B deploy -DskipTests -Prelease --file pom.xml
- name: Release
uses: jreleaser/release-action@v2
with:
arguments: full-release
env:
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD }}
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties