Skip to content

Commit

Permalink
Merge remote-tracking branch 'flashbots/stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
srounce committed Jun 26, 2024
2 parents 591e807 + c2a5d00 commit 2fcabc9
Show file tree
Hide file tree
Showing 44 changed files with 3,805 additions and 1,280 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Linting

on:
push:
branches:
- develop
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.22.0
id: go

- name: Ensure go mod tidy runs without changes
run: |
go mod tidy
git diff-index HEAD
git diff-index --quiet HEAD
- name: Install gofumpt
run: go install mvdan.cc/gofumpt@v0.6.0

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.7

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.1

- name: Lint
run: make lint
123 changes: 123 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
docker-image:
name: Publish Docker Image
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Get tag version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Print version
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Extract metadata (tags, labels) for Docker images
id: meta
uses: docker/metadata-action@v4
with:
images: flashbots/mev-boost
tags: |
type=sha
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ !contains(env.RELEASE_VERSION, '-') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
build-args: |
VERSION=${{ env.RELEASE_VERSION }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-all:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.22
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-build.yaml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: mev-boost-build
path: |
dist/mev-boost*.tar.gz
dist/mev-boost*.txt
release:
needs: build-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.22
- name: Make directories
run: |
mkdir -p ./build
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: mev-boost-build
path: ./build
- name: Merge checksum file
run: |
cd ./build
cat ./mev-boost*checksums.txt >> checksums.txt
rm ./mev-boost*checksums.txt
- name: Release
uses: goreleaser/goreleaser-action@v3
with:
args: release --config .goreleaser-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 0 additions & 70 deletions .github/workflows/releaser.yaml

This file was deleted.

81 changes: 6 additions & 75 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ name: Tests

on:
push:
branches:
- develop
pull_request:
branches: [main]

jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__"
CGO_CFLAGS: "-O -D__BLST_PORTABLE__"
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.18
go-version: ^1.22
id: go

- name: Checkout sources
Expand All @@ -29,72 +27,5 @@ jobs:
uses: codecov/codecov-action@v2
with:
files: ./coverage.out
verbose: true
verbose: false
flags: unittests

lint:
name: Lint
runs-on: ubuntu-latest
env:
CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__"
CGO_CFLAGS: "-O -D__BLST_PORTABLE__"
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go

- name: Checkout sources
uses: actions/checkout@v2

- name: Install revive linter
run: go install github.com/mgechev/revive@v1.1.3

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.3.0

- name: Lint
run: make lint

- name: Ensure go mod tidy runs without changes
run: |
go mod tidy
git diff-index HEAD
git diff-index --quiet HEAD
# mergemock:
# name: Mergemock
# runs-on: ubuntu-latest
# env:
# CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__"
# CGO_CFLAGS: "-O -D__BLST_PORTABLE__"
# steps:
# - name: Set up Go 1.x
# uses: actions/setup-go@v2
# with:
# go-version: ^1.17
# id: go

# - name: Check out code into the Go module directory
# uses: actions/checkout@v2

# - name: Build mev-boost
# run: make build

# - name: Check out the mergemock code repo
# uses: actions/checkout@v2
# with:
# repository: protolambda/mergemock
# path: mergemock
# ref: master

# - name: Download mergemock genesis.json
# run: cd mergemock && wget https://gist.githubusercontent.com/lightclient/799c727e826483a2804fc5013d0d3e3d/raw/2e8824fa8d9d9b040f351b86b75c66868fb9b115/genesis.json && echo -n 'a21a16ec22a940990922220e4ab5bf4c2310f55622220e4ab5bf4c2310f55656' > jwt.hex

# - name: Build mergemock
# run: cd mergemock && go build . mergemock

# - name: Run mergemock consensus tests
# run: |
# make MERGEMOCK_DIR=./mergemock run-mergemock-integration
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
/mev-boost
/test-cli
/tmp
/dist
.vscode/
/README.internal.md
/validator_data.json
/validator_data.json
/build/
Loading

0 comments on commit 2fcabc9

Please sign in to comment.