Release #43
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: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout from Git' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 'Set up JDK' | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: temurin | |
cache: maven | |
- name: 'Calculate next version' | |
run: echo "NEXT_VERSION=$(bash .github/scripts/next-version.sh ${{ github.event.inputs.version }})" >> "$GITHUB_ENV" | |
- name: 'Print version information' | |
run: echo -e "New version ${{ github.event.inputs.version }}\nNext version $NEXT_VERSION" | |
- name: 'Set release version' | |
run: mvn versions:set --no-transfer-progress --batch-mode -DnewVersion=${{ github.event.inputs.version }} | |
- name: 'Update version in documentation' | |
run: | | |
sed -i "s/<version>.*<\/version>/<version>${{ github.event.inputs.version }}<\/version>/g" README.md | |
sed -i "s/<version>.*<\/version>/<version>${{ github.event.inputs.version }}<\/version>/g" docs/_includes/maven | |
- name: 'Commit & push changes' | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
message: Bumps version to ${{ github.event.inputs.version }} | |
- name: 'Stage release' | |
run: mvn clean deploy --no-transfer-progress --batch-mode "-DaltDeploymentRepository=local::default::file://$(pwd)/target/staging-deploy" | |
- name: 'Run JReleaser' | |
uses: jreleaser/release-action@v2 | |
with: | |
setup-java: false | |
version: 1.15.0 | |
env: | |
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME }} | |
JRELEASER_MAVENCENTRAL_SONATYPE_TOKEN: ${{ secrets.JRELEASER_MAVENCENTRAL_SONATYPE_TOKEN }} | |
- name: 'Set release version' | |
run: mvn versions:set --no-transfer-progress --batch-mode -DnewVersion="$NEXT_VERSION" | |
- name: 'Commit & push changes' | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
message: "Prepares for next development iteration" | |
tags: false | |
- name: 'Print diagnostic information' | |
run: | | |
echo ">>> output.properties" | |
cat out/jreleaser/output.properties | |
echo "" | |
echo ">>> trace.log" | |
cat out/jreleaser/trace.log |