Skip to content
Open
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
128 changes: 128 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Build artifacts

on:
pull_request:
branches:
- debank
- op-prebedrock
release:
types:
- created
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
AWS_REGION: us-east-1
REGISTRY: public.ecr.aws/b2h7a5c4/chaintable
IMAGE: op-geth
DOCKERFILE: l2geth/Dockerfile

jobs:
build-artifacts:
name: build-${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu2404-linux-x86-64-16c
arch: amd64
- platform: linux/arm64
runner: ubuntu2204-arm64-16c
arch: arm64
runs-on: ${{ matrix.runner }}

permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Set env (determine image tag)
run: |
if [[ "$GITHUB_EVENT_NAME" == "release" ]]; then
REVISION="${GITHUB_REF#refs/tags/}"
else
REVISION="$(git rev-parse --short=7 HEAD)"
fi
REVISION="prebedrock-${REVISION}"
echo "REVISION=${REVISION}" >> "$GITHUB_ENV"
echo "Building commit $(git rev-parse HEAD) as ${REVISION}"

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public

- name: Set up Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push image
uses: docker/build-push-action@v6
with:
file: ${{ env.DOCKERFILE }}
context: .
platforms: ${{ matrix.platform }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ matrix.arch }}-${{ env.REVISION }}
provenance: false

- name: Check geth version
run: |
docker run --rm --pull=always --platform=${{ matrix.platform }} "${REGISTRY}/${IMAGE}:${{ matrix.arch }}-${REVISION}" version

manifest:
name: merge-manifest
needs: build-artifacts
runs-on: ubuntu2404-linux-x86-64-16c

permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Set env (determine image tag)
run: |
if [[ "$GITHUB_EVENT_NAME" == "release" ]]; then
REVISION="${GITHUB_REF#refs/tags/}"
else
REVISION="$(git rev-parse --short=7 HEAD)"
fi
REVISION="prebedrock-${REVISION}"
echo "REVISION=${REVISION}" >> "$GITHUB_ENV"
echo "Publishing commit $(git rev-parse HEAD) as ${REVISION}"

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public

- name: Set up Buildx
uses: docker/setup-buildx-action@v3

- name: Merge manifest
run: |
docker buildx imagetools create --tag "${REGISTRY}/${IMAGE}:${REVISION}" "${REGISTRY}/${IMAGE}:amd64-${REVISION}" "${REGISTRY}/${IMAGE}:arm64-${REVISION}"
docker buildx imagetools inspect "${REGISTRY}/${IMAGE}:${REVISION}"
115 changes: 0 additions & 115 deletions .github/workflows/geth-lint-build.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/geth-release.yml

This file was deleted.

8 changes: 1 addition & 7 deletions l2geth/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# Build Geth in a stock Go builder container
FROM golang:1.23-alpine as builder
FROM golang:1.23-alpine AS builder

RUN apk add --no-cache make gcc musl-dev linux-headers git

ARG ACCESS_TOKEN

RUN git config --global url."https://x-access-token:${ACCESS_TOKEN}@github.com".insteadOf "https://github.com"

ENV GOPRIVATE=github.com/Chaintable/*

COPY ./l2geth /app/l2geth

WORKDIR /app/l2geth
Expand Down
Loading
Loading