Github Release for Besu Plugins #2
Workflow file for this run
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: Github Release for Besu Plugins | |
on: | |
workflow_call: | |
inputs: | |
pluginName: | |
required: true | |
type: string | |
description: 'plugin name used for the tag name, e.g staterecovery' | |
workspaceModulePath: | |
required: true | |
type: string | |
description: 'Path to plugin to release, e.g state-recovery/besu-plugin' | |
version: | |
required: true | |
type: string | |
description: 'Release semantic version: e.g "1.0.0"' | |
workflow_dispatch: | |
inputs: | |
pluginName: | |
required: true | |
type: string | |
description: 'plugin name used for the tag name, e.g staterecovery' | |
workspaceModulePath: | |
required: true | |
type: string | |
description: 'Path to plugin to release, e.g state-recovery/besu-plugin' | |
version: | |
required: true | |
type: string | |
description: 'Release semantic version: e.g "1.0.0"' | |
jobs: | |
release: | |
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Clean | |
# ./gradlew clean is necessary because the build is cached | |
# and cause issues with JReleaser | |
run: ./gradlew clean | |
- name: Build | |
run: | | |
GRAGLE_PATH=:$(echo "${{inputs.workspaceModulePath}}" | sed 's/\//:/g') | |
echo $GRAGLE_PATH | |
./gradlew $GRAGLE_PATH:shadowJar -Pversion=v${{inputs.version}} | |
ls -lh ${{inputs.workspaceModulePath}}/build/libs | |
- name: Release to GitHub | |
uses: jreleaser/release-action@v2 | |
with: | |
arguments: full-release --git-root-search --basedir=${{ github.workspace }}/${{inputs.workspaceModulePath}} -P=version=v${{inputs.version}} | |
env: | |
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }} | |
JRELEASER_TAG_NAME: ${{inputs.pluginName}}-v${{inputs.version}} | |
JRELEASER_PROJECT_VERSION: ${{inputs.version}} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
JRELEASER_GITHUB_USERNAME: ${{ github.actor }} | |
JRELEASER_GITHUB_EMAIL: ${{ github.actor }}@users.noreply.github.com | |
# Persist logs | |
- name: JReleaser release output | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jreleaser-release | |
path: | | |
build/jreleaser/trace.log | |
build/jreleaser/output.properties |