Skip to content

Commit

Permalink
customize checks and release actions for lacchain
Browse files Browse the repository at this point in the history
* customize release workflow
* add release trigger with  workflow dispatch
* fix docker variants to just openjdk-17
* add workflow to create binaries with java-17
* add lacchain dco
* add codeql
* fix codeql
* refactor workflows
* enable to run tests before publishing binaries

Signed-off-by: eum602 <[email protected]>
  • Loading branch information
eum602 committed Nov 2, 2023
1 parent db587b1 commit 7975c56
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: checks
on:
push:
branches: [ main ]
branches: [lacchain_release]
pull_request:
workflow_dispatch:

jobs:
spotless:
runs-on: [besu-research-ubuntu-16]
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout Repo
Expand All @@ -21,7 +21,7 @@ jobs:
- name: spotless
run: ./gradlew --no-daemon --parallel clean spotlessCheck
javadoc_17:
runs-on: [besu-research-ubuntu-8]
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout Repo
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [ lacchain_release ]
pull_request:
branches: [ main ]
branches: [ lacchain_release ]
paths-ignore:
- '**/*.json'
- '**/*.md'
- '**/*.properties'
- '**/*.txt'
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: [besu-research-ubuntu-16]
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/dco.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: dco
on:
pull_request:
workflow_dispatch:

jobs:
dco:
runs-on: [besu-research-ubuntu-8]
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- run: echo "This DCO job runs on pull_request event and workflow_dispatch"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
validation:
name: "Gradle Wrapper Validation"
runs-on: [besu-research-ubuntu-8]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
28 changes: 28 additions & 0 deletions .github/workflows/lacchain-binary-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: release lacchain-besu binary
on:
release:
types: [created]
jobs:
binaryPromoteX64:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Upload the artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'build/distributions/*'
32 changes: 32 additions & 0 deletions .github/workflows/lacchain-docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release lacchain-besu docker
on:
release:
types: released
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
dockerPromoteX64:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build docker image
env:
architecture: "amd64"
dockerVariants: "openjdk-17"
run: ./gradlew --no-daemon "-PdockerVariants=${{ env.dockerVariants }}" "-Prelease.releaseVersion=${{ github.ref_name }}" "-PdockerArtifactName=lacchain-besu" "-PdockerOrgName=${{ env.REGISTRY }}/lacchain" dockerUpload -x test -x :ethereum:evmtool:dockerUpload

0 comments on commit 7975c56

Please sign in to comment.