From 7bbecf0815175fae6c4e3adde8043b4278e174ae Mon Sep 17 00:00:00 2001 From: Leonardo Arias Fonseca Date: Thu, 22 May 2025 19:54:56 -0600 Subject: [PATCH 1/3] Build the RISC-V binary. Part of #630. --- .github/workflows/release.yaml | 63 +++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b71e13f13..18db572a2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,6 +21,11 @@ on: description: "Build Binary" required: false type: boolean + cross-build-binary: + default: true + description: "Cross-build Binary" + required: false + type: boolean features: default: '' description: "Binary Compilation Features" @@ -113,10 +118,66 @@ jobs: name: reth-rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }} path: target/${{ matrix.configs.target }}/release/reth-rbuilder + cross-build-binary: + name: Cross-build binary + needs: extract-version + if: ${{ github.event.inputs.cross-build-binary == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged + runs-on: warp-ubuntu-2404-x64-32x + container: + image: ubuntu:22.04 + permissions: + contents: write + packages: write + env: + target: riscv64gc-unknown-linux-gnu + strategy: + matrix: + features: + - ${{ github.event.inputs.features || '' }} + steps: + - name: Install dependencies + run: | + dpkg --add-architecture riscv64 + echo "deb [arch=riscv64] http://ports.ubuntu.com/ noble main multiverse universe" >> /etc/apt/sources.list + echo "deb [arch=riscv64] http://ports.ubuntu.com/ noble-updates main multiverse universe" >> /etc/apt/sources.list + apt update + apt install --yes \ + build-essential \ + curl \ + git \ + libclang-dev \ + libssl-dev:riscv64 \ + pkg-config + 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: | + git config --global --add safe.directory "$(pwd)" + . $HOME/.cargo/env + rustup target add riscv64gc-unknown-linux-gnu + export CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER="riscv64-linux-gnu-gcc" + export OPENSSL_LIB_DIR="/usr/lib/riscv64-linux-gnu/" + export OPENSSL_INCLUDE_DIR="/usr/include/riscv64-linux-gnu/" + cargo build --release --features=${{ matrix.features }} --target ${{ env.target }} + + - name: Upload rbuilder artifact + uses: actions/upload-artifact@v4 + with: + name: rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ env.target }}${{ matrix.features && '-' }}${{ matrix.features }} + path: target/${{ env.target }}/release/rbuilder + + - name: Upload reth-rbuilder artifact + uses: actions/upload-artifact@v4 + with: + name: reth-rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ env.target }}${{ matrix.features && '-' }}${{ matrix.features }} + path: target/${{ env.target }}/release/reth-rbuilder + draft-release: name: Draft release if: ${{ github.event.inputs.draft-release == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged - needs: [extract-version, build-binary] + needs: [extract-version, build-binary, cross-build-binary] runs-on: warp-ubuntu-latest-x64-16x env: VERSION: ${{ needs.extract-version.outputs.VERSION }} From fc74666f0329fdc5fd90ed8ad6d27a757a8270e6 Mon Sep 17 00:00:00 2001 From: Leonardo Arias Fonseca Date: Thu, 22 May 2025 20:06:29 -0600 Subject: [PATCH 2/3] add gcc --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 18db572a2..0fd77154f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -144,6 +144,7 @@ jobs: apt install --yes \ build-essential \ curl \ + gcc-riscv64-linux-gnu \ git \ libclang-dev \ libssl-dev:riscv64 \ From 98747d7d5c94cda2cf5507184c5842399c159b59 Mon Sep 17 00:00:00 2001 From: Leonardo Arias Fonseca Date: Thu, 22 May 2025 20:07:06 -0600 Subject: [PATCH 3/3] fix spaces --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0fd77154f..1e10270d9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -144,7 +144,7 @@ jobs: apt install --yes \ build-essential \ curl \ - gcc-riscv64-linux-gnu \ + gcc-riscv64-linux-gnu \ git \ libclang-dev \ libssl-dev:riscv64 \