Release using JReleaser #3
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 using JReleaser | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version' | |
required: true | |
nextVersion: | |
description: 'Next version after release (-SNAPSHOT will be added automatically)' | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: JReleaser full release | |
env: | |
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }} | |
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.JRELEASER_MAVENCENTRAL_TOKEN }} | |
JRELEASER_GPG_KEYNAME: ${{ secrets.JRELEASER_GPG_KEYNAME }} | |
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 }} | |
run: ./gradlew --console=plain --no-daemon --stacktrace jreleaserFullRelease -Pversion=${{ github.event.inputs.version }} | |
- name: JReleaser release output | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jreleaser-release | |
path: | | |
build/jreleaser/trace.log | |
build/jreleaser/output.properties | |
- name: Update version in properties | |
run: sed -i 's/^version=.*/version=${{ github.event.inputs.nextVersion }}-SNAPSHOT/g' gradle.properties | |
- name: Commit & Push version update | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
message: "chore: bump version to ${{ github.event.inputs.nextVersion }}-SNAPSHOT" | |
author_email: 'bot@framefork.org' | |
author_name: 'Framefork BOT' | |
branch: master | |
tags: false |