Release #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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: Verify with Maven | |
run: mvn -B verify -DskipTests --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 }} | |
- name: JReleaser output | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jreleaser-release | |
path: | | |
out/jreleaser/trace.log | |
out/jreleaser/output.properties |