Skip to content

Commit

Permalink
Merge branch 'flashbots:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
malik672 authored Dec 16, 2024
2 parents 6b89303 + 171d8fc commit 1bff573
Show file tree
Hide file tree
Showing 129 changed files with 7,485 additions and 2,797 deletions.
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# they will be requested for review when someone opens a pull request.
* @dvush @ZanCorDX @metachris @jakubhruby7 @ferranbt
/crates/ @dvush @ZanCorDX @ferranbt
* @dvush @ZanCorDX @ferranbt @liamaharon @metachris
/crates/ @dvush @ZanCorDX @ferranbt @liamaharon
/.github/ @dvush @ZanCorDX @ferranbt @liamaharon @metachris @sukoneck
11 changes: 8 additions & 3 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- stable
features:
- ""
- "redact_sensitive"
- "redact-sensitive"
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -66,18 +66,23 @@ jobs:
integration:
name: Integration tests
runs-on: warp-ubuntu-latest-x64-16x
needs: lint_and_test
strategy:
matrix:
toolchain:
- stable
features:
- ""
- "redact_sensitive"
- "redact-sensitive"
steps:
- name: Checkout sources
uses: actions/checkout@v4

# https://github.com/dtolnay/rust-toolchain
- name: Setup rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}

- name: Download builder playground
uses: flashbots/[email protected]
with:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/checks_docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Build

on:
workflow_dispatch:
pull_request:
merge_group:
push:
branches: [develop]

jobs:
build-docker:
name: Build Docker image
runs-on: warp-ubuntu-latest-x64-16x

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

- name: Docker QEMU
uses: docker/setup-qemu-action@v3

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

- name: Docker Build
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64
context: .
push: false
129 changes: 48 additions & 81 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,31 @@ on:
- "v*"
workflow_dispatch:
inputs:
draft-release:
default: false
description: "Draft Release"
required: false
type: boolean
build-docker:
default: false
description: "Build Docker"
required: false
type: boolean
default: false
build-binary:
default: true
description: "Build Binary"
required: false
type: boolean
default: true
draft-release:
description: "Draft Release"
features:
default: ''
description: "Binary Compilation Features"
options:
- ''
- 'redact-sensitive'
required: false
type: boolean
default: false
type: choice

jobs:
#
# extract-version extracts the version from the tag or the branch name,
# for reuse in later jobs
#
extract-version:
name: Extract version
runs-on: warp-ubuntu-latest-x64-16x
Expand All @@ -39,32 +43,26 @@ jobs:
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
else
SHA_SHORT="$(echo ${GITHUB_SHA} | cut -c1-7)"
BRANCH_NAME_SAFE="${GITHUB_REF_NAME//\//-}" # replaces "/" in branch name with "-"
VERSION="${BRANCH_NAME_SAFE}-${SHA_SHORT}"
VERSION="$(echo ${GITHUB_SHA} | cut -c1-7)"
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "${VERSION}"
echo "### Version: \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
echo "| | |" >> $GITHUB_STEP_SUMMARY
echo "| ------------------- | ---------------------- |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_REF_TYPE\` | \`${GITHUB_REF_TYPE}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_REF_NAME\` | \`${GITHUB_REF_NAME}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_REF\` | \`${GITHUB_REF}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_SHA\` | \`${GITHUB_SHA}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`VERSION\` | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`FEATURES\` | \`${{ github.event.inputs.features || 'none' }}\` |" >> $GITHUB_STEP_SUMMARY
#
# build-binary builds a release binary for a variety of platforms
#
build-binary:
name: Build binary
needs: extract-version
if: ${{ github.event.inputs.build-binary == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged
runs-on: ${{ matrix.configs.runner }}
env:
VERSION: ${{ needs.extract-version.outputs.VERSION }}
container:
image: ubuntu:22.04
permissions:
contents: write
packages: write
Expand All @@ -75,68 +73,46 @@ jobs:
runner: warp-ubuntu-latest-x64-16x
- target: aarch64-unknown-linux-gnu
runner: warp-ubuntu-latest-arm64-16x
- target: aarch64-apple-darwin
runner: warp-macos-14-arm64-6x
# Paused until docker is pre-installed https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
# - target: aarch64-apple-darwin
# runner: warp-macos-14-arm64-6x
features:
- ""
- "redact_sensitive"
- ${{ github.event.inputs.features || '' }}

steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for built.rs to get GIT_HEAD_REF

# https://github.com/dtolnay/rust-toolchain
- name: Setup rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.configs.target }}

# https://github.com/WarpBuilds/rust-cache
- name: Run WarpBuilds/rust-cache
uses: WarpBuilds/rust-cache@v2
with:
cache-on-failure: true

# https://github.com/Mozilla-Actions/sccache-action
- name: Setup sccache-action
uses: mozilla-actions/[email protected]

- name: Set env vars
- name: Install dependencies
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Prepare output filename
run: |
if [ -z "${{ matrix.features }}" ]; then
OUTPUT_FILENAME="rbuilder-${VERSION}-${{ matrix.configs.target }}.tar.gz"
else
OUTPUT_FILENAME="rbuilder-${VERSION}-${{ matrix.configs.target }}-${{ matrix.features }}.tar.gz"
fi
echo "OUTPUT_FILENAME=$OUTPUT_FILENAME" >> $GITHUB_ENV
echo "Filename: ${OUTPUT_FILENAME}"
apt-get update
apt-get install -y \
build-essential \
curl \
git \
libclang-dev \
libssl-dev \
pkg-config \
protobuf-compiler
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- uses: actions/checkout@v4 # must install git before checkout and set safe.directory after checkout because of container

- name: Build rbuilder binary
run: cargo build --release --features=${{ matrix.features }}

- name: Prepare artifacts
run: |
mkdir -p artifacts
tar -czf "artifacts/${OUTPUT_FILENAME}" -C target/release rbuilder
git config --global --add safe.directory "$(pwd)"
. $HOME/.cargo/env
cargo build --release --features=${{ matrix.features }} --target ${{ matrix.configs.target }}
- name: Upload rbuilder artifact
uses: actions/upload-artifact@v4
with:
name: rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
path: target/${{ matrix.configs.target }}/release/rbuilder

# https://github.com/actions/upload-artifact
- name: Upload artifacts
uses: actions/[email protected]
- name: Upload reth-rbuilder artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT_FILENAME }}
path: artifacts/${{ env.OUTPUT_FILENAME }}
name: reth-rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
path: target/${{ matrix.configs.target }}/release/reth-rbuilder

#
# draft-release runs after building for various targets, collects artifacts and prepares a draft release
# (only when running against a tag!)
#
draft-release:
name: Draft release
if: ${{ github.event.inputs.draft-release == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged
Expand All @@ -150,7 +126,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# https://github.com/actions/download-artifact
- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -164,7 +139,6 @@ jobs:
for file in *; do sha256sum "$file" >> sha256sums.txt; done;
cat sha256sums.txt
# https://github.com/softprops/action-gh-release
- name: Create release draft
uses: softprops/[email protected]
id: create-release-draft
Expand All @@ -181,12 +155,6 @@ jobs:
echo "### Release Draft: ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.create-release-draft.outputs.url }}" >> $GITHUB_STEP_SUMMARY
#
# build-docker builds a Docker image and pushes it to the GitHub Container Registry at ghcr.io
#
# See also
# - https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
#
build-docker:
if: ${{ github.event.inputs.build-docker == 'true' }}
name: Build and publish Docker image
Expand All @@ -208,7 +176,6 @@ jobs:
- name: docker buildx
uses: docker/setup-buildx-action@v3

# https://github.com/docker/metadata-action
- name: docker metadata
uses: docker/metadata-action@v5
id: meta
Expand Down
Loading

0 comments on commit 1bff573

Please sign in to comment.