Skip to content

Commit

Permalink
staterecovery: add github release (#575)
Browse files Browse the repository at this point in the history
* staterecovery: add github release
  • Loading branch information
jpnovais authored Jan 20, 2025
1 parent d01ef99 commit 26d6120
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 19 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/reuse-github-release-besu-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
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}}
- name: Release to GitHub
uses: jreleaser/release-action@v2
with:
arguments: full-release --git-root-search --basedir=${{ github.workspace }}/${{inputs.workspaceModulePath}}
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
45 changes: 26 additions & 19 deletions .github/workflows/staterecovery-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,35 @@ jobs:
- name: Staterecovery - Build plugin shadowJar
run: |
./gradlew state-recovery:besu-plugin:shadowJar
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run integration tests
timeout-minutes: 15
run: |
./gradlew state-recovery:test-cases:integrationTest
- name: Run Jacoco
- name: Run Jacoco Staterecovery
run: |
./gradlew jacocoRootReport
- name: Upload Jacoco test coverage report
uses: actions/upload-artifact@v4
with:
name: jacocoRootReport-${{ env.COMMIT_TAG }}.xml
if-no-files-found: error
path: |
${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
- name: Upload coverage to Codecov
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: ${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
flags: kotlin
os: linux
name: codecov-staterecovery
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
# TMP disable as it conflicts with coordinator report
# - name: Upload Jacoco report Staterecovery
# uses: actions/upload-artifact@v4
# with:
# name: jacocoRootReport-${{ env.COMMIT_TAG }}.xml
# if-no-files-found: error
# path: |
# ${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
# - name: Upload coverage to Codecov Staterecovery
# if: ${{ env.CODECOV_TOKEN != '' }}
# uses: codecov/codecov-action@v5
# with:
# fail_ci_if_error: true
# files: ${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
# flags: kotlin
# os: linux
# name: codecov-staterecovery
# verbose: true
# token: ${{ secrets.CODECOV_TOKEN }}
31 changes: 31 additions & 0 deletions state-recovery/besu-plugin/jreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
project:
name: staterecovery
description: Linea State Recovery Besu Plugin
longDescription: Besu Plugin to allow Linea rollup state recovery from L1 Blob data
links:
homepage: https://github.com/Consensys/linea-monorepo
authors:
- Linea automations
license: APACHE-2.0
inceptionYear: '2025'
stereotype: NONE
java:
version: '21'
groupId: build.linea
artifactId: staterecovery-besu-plugin

release:
github:
overwrite: true
releaseName: 'State Recovery'
changelog:
enabled: false
commitAuthor:
name: 'Linea automations'
email: 'linea-automations@consensys.net'

distributions:
staterecovery:
type: SINGLE_JAR
artifacts:
- path: 'build/libs/{{tagName}}.jar'

0 comments on commit 26d6120

Please sign in to comment.