From 304ea2995b5d7ad9bc623144c2fa6d4469e15605 Mon Sep 17 00:00:00 2001 From: naveen-consensys <159963501+naveen-consensys@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:26:07 +0700 Subject: [PATCH] Devnet-Add release pipeline for devnet (#120) --- .github/workflows/linea-devnet.yml | 117 +++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/workflows/linea-devnet.yml diff --git a/.github/workflows/linea-devnet.yml b/.github/workflows/linea-devnet.yml new file mode 100644 index 0000000..606e487 --- /dev/null +++ b/.github/workflows/linea-devnet.yml @@ -0,0 +1,117 @@ +name: linea-devnet + +on: + workflow_call: + outputs: + workflow_run_id: + description: "the run id of the workflow" + value: ${{ jobs.build.outputs.workflow_run_id }} + workflow_dispatch: + +permissions: + id-token: write + contents: read + +jobs: + build: + runs-on: ubuntu-latest + environment: build + outputs: + workflow_run_id: ${{ steps.workflow_details.outputs.id }} + steps: + + - name: checkout + uses: actions/checkout@v4 + + - name: get workflow_details + id: workflow_details + run: echo "id=${{ github.run_id }}" >> $GITHUB_OUTPUT + + - name: get versions via dotenv + id: dotenv + uses: falti/dotenv-action@v1 + with: + path: versions/linea-devnet.env + mode: development + keys-case: lower + log-variables: true + load-mode: strict + + - name: set docker tag + id: dockertag + run: | + if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref_type }}" == "tag" ]; then + echo "IMAGE=devnet-${{ github.ref_name }}" >> $GITHUB_OUTPUT + else + echo "IMAGE=devnet-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + fi + + - name: download and untar the linea-besu archive + run: | + cd /tmp/ + echo "downloading linea-besu: ${{ steps.dotenv.outputs.linea_besu_tar_gz }}" + wget -nv "https://artifacts.consensys.net/public/linea-besu/raw/names/linea-besu.tar.gz/versions/${{ steps.dotenv.outputs.linea_besu_tar_gz }}/linea-besu-${{ steps.dotenv.outputs.linea_besu_tar_gz }}.tar.gz" + tar -xvf linea-besu-${{ steps.dotenv.outputs.linea_besu_tar_gz }}.tar.gz + mkdir -p /opt/besu + mv /tmp/linea-besu-${{ steps.dotenv.outputs.linea_besu_tar_gz }}/* /opt/besu/ + echo "moved to /opt/besu" + + - name: copy the list of versions to the container + run: | + cp ./versions/linea-devnet.env /opt/besu/versions.txt + mkdir -p /opt/besu/plugins + + - name: get the plugins + run: | + cd /opt/besu/plugins + + echo "getting linea_sequencer_plugin_version: ${{ steps.dotenv.outputs.linea_sequencer_plugin_version }}" + wget -nv "https://github.com/Consensys/linea-sequencer/releases/download/v${{ steps.dotenv.outputs.linea_sequencer_plugin_version }}/besu-sequencer-plugins-v${{ steps.dotenv.outputs.linea_sequencer_plugin_version }}.jar" -P /opt/besu/plugins + + echo "getting finalized_tag_updater_plugin_version: ${{ steps.dotenv.outputs.finalized_tag_updater_plugin_version }}" + wget -nv "https://github.com/Consensys/linea-monorepo/releases/download/finalized-tag-updater-v${{ steps.dotenv.outputs.finalized_tag_updater_plugin_version }}/finalized-tag-updater-v${{ steps.dotenv.outputs.finalized_tag_updater_plugin_version }}.jar" -P /opt/besu/plugins + + echo "getting linea_tracer_plugin_version: ${{ steps.dotenv.outputs.linea_tracer_plugin_version }}" + wget -nv "https://github.com/Consensys/linea-tracer/releases/download/v${{ steps.dotenv.outputs.linea_tracer_plugin_version }}/linea-tracer-v${{ steps.dotenv.outputs.linea_tracer_plugin_version }}.jar" -P /opt/besu/plugins + + echo "getting shomei_plugin_version: ${{ steps.dotenv.outputs.shomei_plugin_version }}" + wget -nv "https://github.com/Consensys/besu-shomei-plugin/releases/download/v${{ steps.dotenv.outputs.shomei_plugin_version }}/besu-shomei-plugin-v${{ steps.dotenv.outputs.shomei_plugin_version }}.jar" -P /opt/besu/plugins + + - name: piece the package together to build the docker images + run: | + cd linea-besu + mv /opt/besu ./ + mv config/ genesis/ profiles/ besu/ + tree . + + # - name: set up docker buildx + # uses: docker/setup-buildx-action@v3 + + # - name: login to docker + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKER_USER_RW }} + # password: ${{ secrets.DOCKER_PASSWORD_RW }} + + # - name: set docker build args + # run: | + # echo "BUILD_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV} + # echo "Building image tag: ${{ steps.dockertag.outputs.IMAGE }}" + + # - name: build and push the combined manifest + # uses: docker/build-push-action@v6 + # env: + # DOCKER_BUILD_SUMMARY: false + # with: + # context: besu-fleet/. + # platforms: linux/arm64,linux/amd64 + # provenance: false + # cache-from: type=local,src=/tmp/.buildx-cache + # cache-to: type=local,dest=/tmp/.buildx-cache + # build-args: | + # VERSION=${{ steps.dockertag.outputs.IMAGE }} + # VCS_REF=${{ github.sha }} + # BUILD_DATE=${{ env.BUILD_DATE }} + # push: true + # tags: | + # consensys/linea-besu-package:${{ steps.dockertag.outputs.IMAGE }} \ No newline at end of file