Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): tomorrow #149

Merged
merged 7 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ inputs:
platform:
description: The platform to build for
type: string
# TODO: remove default and switch required true when tested
default: linux/amd64
required: false
required: true
# Secrets
DOCKER_USERNAME:
required: true
Expand Down
26 changes: 18 additions & 8 deletions .github/actions/manifest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ description: Build and push a docker manifest to Docker Hub

inputs:
platforms:
description: Comma-separated list of platforms (e.g. linux/amd64,linux/arm64)
# eg [{"platform":"linux/amd64", "runner": "ARM64", "slug": "something-arm64"},{"platform":"linux/arm64", "runner": "ubuntu-latest", "slug": "something-amd64"}]
description: JSON list of platforms to build for
type: string
required: true
source_repository:
Expand All @@ -22,7 +23,6 @@ inputs:
description: Docker hub repository to push to
type: string
required: true
# Secrets
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
Expand All @@ -49,17 +49,27 @@ runs:
id: generate_images_list
shell: bash
run: |
PLATFORMS="${{ inputs.platforms }}"
IMAGES=""
PLATFORMS='${{ inputs.platforms }}'

IFS=',' read -ra ADDR <<< "$PLATFORMS"
for platform in "${ADDR[@]}"; do
slug=$(echo "$platform" | tr '/' '-')
IMAGES+="${{ inputs.target_repository }}:${{ inputs.target_tag }}-$slug "
# Iterate over the platforms and build the image list
len=$(echo $PLATFORMS | jq '. | length')
for ((i=0; i<$len; i++)); do
slug=$(echo $PLATFORMS | jq -r --argjson i $i '.[$i].slug')
imagetag="${{ inputs.target_tag }}-$slug"
image="${{ inputs.target_repository }}:$imagetag"
url="https://hub.docker.com/v2/repositories/${{ inputs.target_repository }}/tags?page_size=25&page=1&ordering=&name=$imagetag"
exists=$(curl -s $url | jq '.results | length > 0')
if [ "$exists" == "true" ]; then
IMAGES+="${{ inputs.target_repository }}:${{ inputs.target_tag }}-$slug "
fi
done

IMAGES=${IMAGES::-1} # Remove the trailing space
echo "images=$IMAGES" >> $GITHUB_OUTPUT
- name: Check if there is atleast one image
if: ${{ steps.generate_images_list.outputs.images == '[]' || steps.generate_images_list.outputs.images == '' }}
shell: bash
run: exit 1
- name: Set up Docker Context for Buildx
shell: bash
id: buildx-context
Expand Down
21 changes: 6 additions & 15 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ inputs:
description: 'The client'
required: true
outputs:
matrix:
description: "Matrix of platforms and runner to use"
value: ${{ steps.setup_matrix.outputs.matrix }}
platforms:
description: "Comma-separated list of platforms"
description: "Matrix of platforms and runner to use"
value: ${{ steps.setup_platforms.outputs.platforms }}
runs:
using: "composite"
Expand All @@ -18,10 +15,10 @@ runs:
uses: actions/checkout@v4
- uses: mikefarah/yq@v4.35.1
- name: Generate platform and runner matrix from config files
id: setup_matrix
id: setup_platforms
shell: bash
run: |
MATRIX_JSON="["
PLATFORMS_JSON="["
client="${{ inputs.client }}"

# Extract the platforms for the specified client
Expand All @@ -30,14 +27,8 @@ runs:
for platform in $platforms; do
slug=$(echo "$platform" | tr '/' '-')
runner=$(yq e ".\"$platform\"" runners.yaml)
MATRIX_JSON+="{\"platform\":\"$platform\", \"runner\":\"$runner\", \"slug\":\"$slug\"},"
PLATFORMS_JSON+="{\"platform\":\"$platform\", \"runner\":\"$runner\", \"slug\":\"$slug\"},"
done

MATRIX_JSON="${MATRIX_JSON%,}]"
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
- name: Generate platforms comma-separated list
id: setup_platforms
shell: bash
run: |
PLATFORMS=$(echo '${{ steps.setup_matrix.outputs.matrix }}' | jq -r '.[] | .platform' | paste -sd "," -)
echo "platforms=$PLATFORMS" >> $GITHUB_OUTPUT
PLATFORMS_JSON="${PLATFORMS_JSON%,}]"
echo "platforms=$PLATFORMS_JSON" >> $GITHUB_OUTPUT
4 changes: 2 additions & 2 deletions .github/workflows/build-push-armiarma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-beacon-metrics-gazer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-besu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-consensus-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-eleel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-erigon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-ethereumjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-execution-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-flashbots-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-genesis-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-goomy-blob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-goteth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-push-grandine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup.outputs.matrix }}
platforms: ${{ steps.setup.outputs.platforms }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +34,10 @@ jobs:
needs:
- prepare
runs-on: ${{ matrix.runner }}
continue-on-error: true
strategy:
matrix:
include: ${{fromJson(needs.prepare.outputs.matrix)}}
include: ${{fromJson(needs.prepare.outputs.platforms)}}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
Expand Down
Loading