|
16 | 16 | DOCKER_USERNAME: ${{ github.actor }} |
17 | 17 |
|
18 | 18 | jobs: |
19 | | - build: |
20 | | - name: build and push |
21 | | - runs-on: ubuntu-20.04 |
22 | | - permissions: |
23 | | - packages: write |
24 | | - contents: read |
| 19 | + build-x86: |
| 20 | + name: Build x86 binary |
| 21 | + runs-on: ubuntu-24.04 |
25 | 22 | steps: |
26 | 23 | - uses: actions/checkout@v4 |
27 | 24 | - uses: dtolnay/rust-toolchain@stable |
28 | 25 | - uses: Swatinem/rust-cache@v2 |
29 | 26 | with: |
30 | 27 | cache-on-failure: true |
31 | 28 | - uses: taiki-e/install-action@cross |
32 | | - - name: Log in to Docker |
| 29 | + - name: Set up Docker builder |
33 | 30 | run: | |
34 | | - echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin |
| 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 |
35 | 51 | - name: Set up Docker builder |
36 | 52 | run: | |
37 | 53 | docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 |
38 | 54 | docker buildx create --use --name cross-builder |
39 | | - - name: Build and push fraxtal-op-reth image, tag as "latest" |
40 | | - run: make PROFILE=maxperf docker-build-push-latest |
41 | | - - name: Build and push fraxtal-op-reth image |
42 | | - run: make PROFILE=maxperf docker-build-push |
| 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-24.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/{amd64,arm64} |
| 78 | + - name: Download x86 artifact |
| 79 | + uses: actions/download-artifact@v4 |
| 80 | + with: |
| 81 | + name: fraxtal-op-reth-x86 |
| 82 | + path: dist/bin/amd64/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/arm64/fraxtal-op-reth |
| 88 | + - name: Set up Docker builder |
| 89 | + run: docker buildx create --use --name fraxtal |
| 90 | + - name: Build and push fraxtal-op-reth nightly image |
| 91 | + run: | |
| 92 | + docker buildx build --file ./Dockerfile.cross . \ |
| 93 | + --platform linux/amd64,linux/arm64 \ |
| 94 | + --tag ghcr.io/fraxfinance/fraxtal-op-reth:${{ github.ref_name }} \ |
| 95 | + --tag ghcr.io/fraxfinance/fraxtal-op-reth:latest \ |
| 96 | + --provenance=false \ |
| 97 | + --push |
0 commit comments