Add nightly builds #4
This file contains 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
# Taken form upstream reth | |
# https://github.com/paradigmxyz/reth/blob/3212af2d85a54eb207661361ac9fe1d7de4b5b8e/.github/workflows/docker.yml | |
name: release | |
on: | |
push: | |
branches: | |
- master | |
env: | |
REPO_NAME: ${{ github.repository_owner }}/fraxtal-op-reth | |
IMAGE_NAME: ${{ github.repository_owner }}/fraxtal-op-reth | |
DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/fraxtal-op-reth | |
CARGO_TERM_COLOR: always | |
DOCKER_USERNAME: ${{ github.actor }} | |
jobs: | |
build-x86: | |
name: Build x86 binary | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- uses: taiki-e/install-action@cross | |
- name: Set up Docker builder | |
run: | | |
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 | |
docker buildx create --use --name cross-builder | |
- name: Build | |
run: make PROFILE=maxperf build-native-x86_64-unknown-linux-gnu | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fraxtal-op-reth-x86 | |
path: target/x86_64-unknown-linux-gnu/maxperf/fraxtal-op-reth | |
retention-days: 1 | |
build-arm: | |
name: Build arm binary | |
runs-on: ubuntu-24.04-arm | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- uses: taiki-e/install-action@cross | |
- name: Set up Docker builder | |
run: | | |
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 | |
docker buildx create --use --name cross-builder | |
- name: Build | |
run: make PROFILE=maxperf build-native-aarch64-unknown-linux-gnu | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fraxtal-op-reth-arm | |
path: target/aarch64-unknown-linux-gnu/maxperf/fraxtal-op-reth | |
retention-days: 1 | |
build-docker: | |
name: build and push docker image | |
needs: [build-x86, build-arm] | |
runs-on: ubuntu-20.04 | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to Docker | |
run: | | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin | |
- name: Create artifacts dirs | |
run: mkdir -p dist/bin/{build-x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu} | |
- name: Download x86 artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: fraxtal-op-reth-x86 | |
path: dist/bin/build-x86_64-unknown-linux-gnu/fraxtal-op-reth | |
- name: Download arm artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: fraxtal-op-reth-arm | |
path: dist/bin/build-arm_64-unknown-linux-gnu/fraxtal-op-reth | |
- name: Set up Docker builder | |
run: docker buildx create --use --name fraxtal | |
- name: Build and push fraxtal-op-reth nightly image | |
run: | | |
docker buildx build --file ./Dockerfile.cross . \ | |
--platform linux/amd64,linux/arm64 \ | |
--tag latest-nightly \ | |
--provenance=false \ | |
--push |