From 7975c562bec50a72d95ab69dc3f6c8df3a63ccb2 Mon Sep 17 00:00:00 2001 From: eum602 Date: Mon, 2 Oct 2023 02:05:02 -0500 Subject: [PATCH] customize checks and release actions for lacchain * 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 --- .github/workflows/checks.yml | 6 ++-- .github/workflows/codeql.yml | 7 ++-- .github/workflows/dco.yml | 3 +- .../workflows/gradle-wrapper-validation.yml | 2 +- .github/workflows/lacchain-binary-release.yml | 28 ++++++++++++++++ .github/workflows/lacchain-docker-release.yml | 32 +++++++++++++++++++ 6 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/lacchain-binary-release.yml create mode 100644 .github/workflows/lacchain-docker-release.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9fdae30a99b..0a32bb8e7ac 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -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 @@ -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 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 100be39e0df..e0544a93e00 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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 diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml index 5fa9931c77a..6ae4bb233ac 100644 --- a/.github/workflows/dco.yml +++ b/.github/workflows/dco.yml @@ -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" diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 2be77e8c2ea..24a1c4ff4e8 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -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 diff --git a/.github/workflows/lacchain-binary-release.yml b/.github/workflows/lacchain-binary-release.yml new file mode 100644 index 00000000000..86cdba5d246 --- /dev/null +++ b/.github/workflows/lacchain-binary-release.yml @@ -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/*' \ No newline at end of file diff --git a/.github/workflows/lacchain-docker-release.yml b/.github/workflows/lacchain-docker-release.yml new file mode 100644 index 00000000000..8a45d0c83bc --- /dev/null +++ b/.github/workflows/lacchain-docker-release.yml @@ -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 \ No newline at end of file