|
| 1 | +# Taken form upstream reth |
| 2 | +# https://github.com/paradigmxyz/reth/blob/3212af2d85a54eb207661361ac9fe1d7de4b5b8e/.github/workflows/docker.yml |
| 3 | + |
| 4 | +name: release |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + |
| 11 | +env: |
| 12 | + REPO_NAME: ${{ github.repository_owner }}/fraxtal-op-reth |
| 13 | + IMAGE_NAME: ${{ github.repository_owner }}/fraxtal-op-reth |
| 14 | + DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/fraxtal-op-reth |
| 15 | + CARGO_TERM_COLOR: always |
| 16 | + DOCKER_USERNAME: ${{ github.actor }} |
| 17 | + |
| 18 | +jobs: |
| 19 | + build-x86: |
| 20 | + name: Build x86 binary |
| 21 | + runs-on: ubuntu-20.04 |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - uses: dtolnay/rust-toolchain@stable |
| 25 | + - uses: Swatinem/rust-cache@v2 |
| 26 | + with: |
| 27 | + cache-on-failure: true |
| 28 | + - uses: taiki-e/install-action@cross |
| 29 | + - name: Set up Docker builder |
| 30 | + run: | |
| 31 | + docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 |
| 32 | + docker buildx create --use --name cross-builder |
| 33 | + - name: Build |
| 34 | + run: make PROFILE=maxperf build-native-x86_64-unknown-linux-gnu |
| 35 | + - name: Upload artifact |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: fraxtal-op-reth-x86 |
| 39 | + path: target/x86_64-unknown-linux-gnu/maxperf/fraxtal-op-reth |
| 40 | + retention-days: 1 |
| 41 | + build-arm: |
| 42 | + name: Build arm binary |
| 43 | + runs-on: ubuntu-24.04-arm |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + - uses: dtolnay/rust-toolchain@stable |
| 47 | + - uses: Swatinem/rust-cache@v2 |
| 48 | + with: |
| 49 | + cache-on-failure: true |
| 50 | + - uses: taiki-e/install-action@cross |
| 51 | + - name: Set up Docker builder |
| 52 | + run: | |
| 53 | + docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 |
| 54 | + docker buildx create --use --name cross-builder |
| 55 | + - name: Build |
| 56 | + run: make PROFILE=maxperf build-native-aarch64-unknown-linux-gnu |
| 57 | + - name: Upload artifact |
| 58 | + uses: actions/upload-artifact@v4 |
| 59 | + with: |
| 60 | + name: fraxtal-op-reth-arm |
| 61 | + path: target/aarch64-unknown-linux-gnu/maxperf/fraxtal-op-reth |
| 62 | + retention-days: 1 |
| 63 | + |
| 64 | + build-docker: |
| 65 | + name: build and push docker image |
| 66 | + needs: [build-x86, build-arm] |
| 67 | + runs-on: ubuntu-20.04 |
| 68 | + permissions: |
| 69 | + packages: write |
| 70 | + contents: read |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
| 73 | + - name: Log in to Docker |
| 74 | + run: | |
| 75 | + echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin |
| 76 | + - name: Create artifacts dirs |
| 77 | + run: mkdir -p dist/bin/{build-x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu} |
| 78 | + - name: Download x86 artifact |
| 79 | + uses: actions/download-artifact@v4 |
| 80 | + with: |
| 81 | + name: fraxtal-op-reth-x86 |
| 82 | + path: dist/bin/build-x86_64-unknown-linux-gnu/fraxtal-op-reth |
| 83 | + - name: Download arm artifact |
| 84 | + uses: actions/download-artifact@v4 |
| 85 | + with: |
| 86 | + name: fraxtal-op-reth-arm |
| 87 | + path: dist/bin/build-arm_64-unknown-linux-gnu/fraxtal-op-reth |
| 88 | + - name: Build and push fraxtal-op-reth nightly image |
| 89 | + run: | |
| 90 | + docker buildx build --file ./Dockerfile.cross . \ |
| 91 | + --platform linux/amd64,linux/arm64 \ |
| 92 | + --tag latest-nightly \ |
| 93 | + --provenance=false \ |
| 94 | + --push |
0 commit comments