Support EIP-8141 frame transactions #1657
This file contains hidden or 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: Build DEV version | |
| on: | |
| pull_request: | |
| types: [synchronize] | |
| workflow_dispatch: | |
| inputs: | |
| docker_tag: | |
| description: "Docker Tag Prefix (leave blank for no docker build)" | |
| required: false | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| prinfo: | |
| name: "Get PR info" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run_builds: ${{ steps.loadinfo.outputs.run_builds }} | |
| build_docker: ${{ steps.loadinfo.outputs.build_docker }} | |
| docker_tag: ${{ steps.loadinfo.outputs.docker_tag }} | |
| # commit_ref = the EXACT PR head sha. Passed to the build workflow so it builds the | |
| # real branch code and NOT the auto-generated PR/master merge commit. DO NOT REMOVE. | |
| commit_ref: ${{ steps.loadinfo.outputs.commit_ref }} | |
| steps: | |
| - name: "Load PR info" | |
| id: loadinfo | |
| env: | |
| HAS_DOCKER_IMAGE_LABEL: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'build-docker-image') }} | |
| SAME_REPOSITORY_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} | |
| MANUAL_DOCKER_TAG: ${{ inputs.docker_tag }} | |
| # PR head sha (exact branch HEAD). Read via env to avoid script injection. DO NOT REMOVE. | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| FALLBACK_SHA: ${{ github.sha }} | |
| run: | | |
| has_docker_image_label="$HAS_DOCKER_IMAGE_LABEL" | |
| same_repository_pr="$SAME_REPOSITORY_PR" | |
| run_builds="$has_docker_image_label" | |
| build_docker="false" | |
| echo "docker image label: $has_docker_image_label" | |
| echo "same repository PR: $same_repository_pr" | |
| branch_name="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | |
| branch_name="$(echo "$branch_name" | sed 's/\//-/g')" | |
| echo "branch name: $branch_name" | |
| # Build the EXACT pushed commit. On a `pull_request` event, actions/checkout with no | |
| # ref defaults to refs/pull/<N>/merge (branch MERGED with master) — wrong for diverged | |
| # branches. Pinning head.sha avoids that. DO NOT REMOVE — see _shared-build.yaml `ref`. | |
| commit_ref="$HEAD_SHA" | |
| if [[ -z "$commit_ref" ]]; then | |
| commit_ref="$FALLBACK_SHA" | |
| fi | |
| echo "commit ref: $commit_ref" | |
| manual_tag="$MANUAL_DOCKER_TAG" | |
| if [[ ! -z "$manual_tag" ]]; then | |
| branch_name="$manual_tag" | |
| run_builds="true" | |
| build_docker="true" | |
| elif [[ "$has_docker_image_label" == "true" ]] && [[ "$same_repository_pr" == "true" ]]; then | |
| build_docker="true" | |
| elif [[ "$has_docker_image_label" == "true" ]]; then | |
| echo "Skipping docker push for forked PR; dispatch this workflow manually to publish a trusted build." | |
| fi | |
| if [[ "$branch_name" == "master" ]] || [[ "$branch_name" =~ ^v[0-9] ]]; then | |
| echo "Invalid branch name! Skipping builds" | |
| run_builds="false" | |
| build_docker="false" | |
| fi | |
| echo "run_builds=$run_builds" >> $GITHUB_OUTPUT | |
| echo "build_docker=$build_docker" >> $GITHUB_OUTPUT | |
| echo "docker_tag=$branch_name" >> $GITHUB_OUTPUT | |
| echo "commit_ref=$commit_ref" >> $GITHUB_OUTPUT | |
| build_binaries: | |
| name: "Build Dora" | |
| needs: [prinfo] | |
| if: ${{ needs.prinfo.outputs.run_builds == 'true' && needs.prinfo.outputs.build_docker != 'true' }} | |
| uses: ./.github/workflows/_shared-build.yaml | |
| with: | |
| ref: ${{ needs.prinfo.outputs.commit_ref }} # exact branch HEAD, NOT the PR/master merge. DO NOT REMOVE. | |
| docker: false | |
| docker_repository: "ethpandaops/dora" | |
| docker_tag_prefix: ${{needs.prinfo.outputs.docker_tag}} | |
| additional_tags: "['${{needs.prinfo.outputs.docker_tag}}','${{needs.prinfo.outputs.docker_tag}}-latest']" | |
| build_binaries_and_docker: | |
| name: "Build Dora and Docker image" | |
| needs: [prinfo] | |
| if: ${{ needs.prinfo.outputs.run_builds == 'true' && needs.prinfo.outputs.build_docker == 'true' }} | |
| uses: ./.github/workflows/_shared-build.yaml | |
| with: | |
| ref: ${{ needs.prinfo.outputs.commit_ref }} # exact branch HEAD, NOT the PR/master merge. DO NOT REMOVE. | |
| docker: true | |
| docker_repository: "ethpandaops/dora" | |
| docker_tag_prefix: ${{needs.prinfo.outputs.docker_tag}} | |
| additional_tags: "['${{needs.prinfo.outputs.docker_tag}}','${{needs.prinfo.outputs.docker_tag}}-latest']" | |
| secrets: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |