Skip to content

Remove the ipa-multipoint library (#315) #983

Remove the ipa-multipoint library (#315)

Remove the ipa-multipoint library (#315) #983

Workflow file for this run

name: Build and publish
on:
pull_request:
push:
branches:
- main
jobs:
check-version:
# Upon push to main, check-version returns error if release version is already published ensuring build-*/publish jobs are skipped.
# check-version is skipped on PRs, however downstream build-* jobs still run on PRs.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Check whether gradle.properties version has been released already
# This prevents accidentally publishing the same version
# Only check binary for arithmetic as all are published together
- name: Check release not already published
shell: bash
run: |
# Only interested in release version
if [[ $(grep -E 'version=[0-9]+\.[0-9]+\.[0-9]+$' gradle.properties | wc -l) -ne 0 ]]
then
VERSION=$(grep "^version" gradle.properties | sed 's|^version=\(.*\)$|\1|g')
echo "Query for version [$VERSION]"
RESPONSE_CODE=$(curl --head -L --silent --output /dev/null --write-out %{http_code} "$ART_URL/$VERSION")
echo "Response code for curl command [$RESPONSE_CODE]"
if [[ $RESPONSE_CODE == "404" ]]
then
echo "Version [$VERSION] has not yet been published"
elif [[ $RESPONSE_CODE == "200" ]]
then
echo "ERROR: Binary arithmetic already exists for version [$VERSION]"
echo "ERROR: Blocking republishing same version to the Besu Artifactory"
echo "url $ART_URL/$VERSION"
exit 1
else
echo "WARN: Unable to check whether version has been published previously"
echo "WARN: Failing job due to unknown status"
exit 1
fi
else
echo "No validation as not a release version"
fi
env:
ART_URL: 'https://hyperledger.jfrog.io/artifactory/besu-maven/org/hyperledger/besu/arithmetic'
native-build-linux-x86-64:
needs: check-version
# Run if check-version succeeded (push to main) or was skipped (PRs, where check-version doesn't apply).
# always() is needed because jobs that depend on a skipped job are skipped by default.
if: always() && (needs.check-version.result == 'success' || needs.check-version.result == 'skipped')
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
env:
SKIP_GRADLE: true
steps:
- name: Prepare
run: |
# secp256k1 dependencies
apt-get update
apt upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf build-essential libtool automake wget git curl openjdk-21-jdk cmake
apt autoremove -y
echo "JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))" >> $GITHUB_ENV
# golang dependencies
wget https://go.dev/dl/go1.25.4.linux-amd64.tar.gz
echo "9fa5ffeda4170de60f67f3aa0f824e426421ba724c21e133c1e35d6159ca1bec go1.25.4.linux-amd64.tar.gz" | sha256sum -c || exit 1
tar -xzf go1.25.4.linux-amd64.tar.gz -C /usr/local && ln -s /usr/local/go/bin/go /usr/local/bin/go
# rust dependencies
export CARGO_HOME="$HOME/.cargo"
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.89.0
# nim dependencies
export CHOOSENIM_CHOOSE_VERSION=2.2.2
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y
export PATH=$HOME/.nimble/bin:$PATH
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Build
run: ./build.sh
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: arithmetic-native-build-artifacts-linux-x86-64
path: arithmetic/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: blake2bf-native-build-artifacts-linux-x86-64
path: blake2bf/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256k1-native-build-artifacts-linux-x86-64
path: secp256k1/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256r1-native-build-artifacts-linux-x86-64
path: secp256r1/besu-native-ec/release/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: gnark-native-build-artifacts-linux-x86-64
path: gnark/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: constantine-native-build-artifacts-linux-x86-64
path: constantine/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: boringssl-native-build-artifacts-linux-x86-64
path: boringssl/build/
native-build-linux-arm64:
needs: check-version
# Run if check-version succeeded (push to main) or was skipped (PRs, where check-version doesn't apply).
# always() is needed because jobs that depend on a skipped job are skipped by default.
if: always() && (needs.check-version.result == 'success' || needs.check-version.result == 'skipped')
runs-on: besu-arm64
env:
SKIP_GRADLE: true
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Build
run: |
docker run -e SKIP_GRADLE=$SKIP_GRADLE -v $(pwd):/home/ubuntu ubuntu:22.04 /home/ubuntu/native-build.sh
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: arithmetic-native-build-artifacts-linux-arm64
path: arithmetic/build/
# blake2bf is not built for linux-arm64
# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
# with:
# name: blake2bf-native-build-artifacts-linux-arm64
# path: blake2bf/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256k1-native-build-artifacts-linux-arm64
path: secp256k1/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256r1-native-build-artifacts-linux-arm64
path: secp256r1/besu-native-ec/release/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: gnark-native-build-artifacts-linux-arm64
path: gnark/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: constantine-native-build-artifacts-linux-arm64
path: constantine/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: boringssl-native-build-artifacts-linux-arm64
path: boringssl/build/
native-build-macos:
needs: check-version
# Run if check-version succeeded (push to main) or was skipped (PRs, where check-version doesn't apply).
# always() is needed because jobs that depend on a skipped job are skipped by default.
if: always() && (needs.check-version.result == 'success' || needs.check-version.result == 'skipped')
runs-on: macos-15-intel
env:
SKIP_GRADLE: true
steps:
- name: Prepare
run: |
# secp256k1 dependencies
brew install autoconf automake libtool
# gnark dependencies
brew install go@1.25 || true
# Unlink brew llvm to prevent x86_64-only libunwind from breaking arm64 cross-compilation
brew unlink llvm@18 || true
# rust dependencies
export CARGO_HOME="$HOME/.cargo"
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.89.0
# install both x86 and arm64 toolchains
export PATH="$HOME/.cargo/bin:$PATH"
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
# nim dependencies
export CHOOSENIM_CHOOSE_VERSION=2.2.2
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y
export PATH=$HOME/.nimble/bin:$PATH
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Build
run: ./build.sh
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: arithmetic-native-build-artifacts-macos-x86-64
path: arithmetic/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: blake2bf-native-build-artifacts-macos-x86-64
path: blake2bf/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256k1-native-build-artifacts-macos-x86-64
path: secp256k1/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256r1-native-build-artifacts-macos-x86-64
path: secp256r1/besu-native-ec/release/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: gnark-native-build-artifacts-macos-x86-64
path: gnark/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: constantine-native-build-artifacts-macos-x86-64
path: constantine/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: boringssl-native-build-artifacts-macos-x86-64
path: boringssl/build/
native-build-m1:
needs: check-version
# Run if check-version succeeded (push to main) or was skipped (PRs, where check-version doesn't apply).
# always() is needed because jobs that depend on a skipped job are skipped by default.
if: always() && (needs.check-version.result == 'success' || needs.check-version.result == 'skipped')
runs-on: macos-15-xlarge
env:
SKIP_GRADLE: true
steps:
- name: Prepare
run: |
# check for homebrew and install from known sha if it is missing (like on macstadium)
if ! command -v brew &> /dev/null
then
# get pwd for homebrew:
export HOMEBREW_PREFIX=`pwd`/../homebrew
# use local homebrew 4.0.26 release, as brew is not available on macstadium:
mkdir -p $HOMEBREW_PREFIX && curl -L https://github.com/Homebrew/brew/tarball/eff45ef570f265e226f14ce91da72d7a6e7d516a| tar xz --strip 1 -C $HOMEBREW_PREFIX
export PATH=$HOMEBREW_PREFIX/bin:$PATH
echo "HOMEBREW_BIN=$HOMEBREW_PREFIX/bin" >> $GITHUB_ENV
fi
# secp256k1, gnark dependencies
brew install autoconf automake libtool
# gnark dependencies
brew install go@1.25 || true
# rust dependencies
export CARGO_HOME="$HOME/.cargo"
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.89.0
# install both x86 and arm64 toolchains
export PATH="$HOME/.cargo/bin:$PATH"
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
# nim dependencies
export CHOOSENIM_CHOOSE_VERSION=2.2.2
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y
export PATH=$HOME/.nimble/bin:$PATH
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '21'
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: '1.25'
- name: Build
run: |
export HOMEBREW_BIN=${{ env.HOMEBREW_BIN }}
export PATH=$HOMEBREW_BIN:$PATH
./build.sh
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: arithmetic-native-build-artifacts-macos-arm64
path: arithmetic/build/
# blake2bf is not built for macos-arm64
# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
# with:
# name: blake2bf-native-build-artifacts-macos-arm64
# path: blake2bf/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256k1-native-build-artifacts-macos-arm64
path: secp256k1/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: secp256r1-native-build-artifacts-macos-arm64
path: secp256r1/besu-native-ec/release/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: gnark-native-build-artifacts-macos-arm64
path: gnark/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: constantine-native-build-artifacts-macos-arm64
path: constantine/build/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: boringssl-native-build-artifacts-macos-arm64
path: boringssl/build/
final-assembly:
runs-on: ubuntu-latest
needs:
- native-build-macos
- native-build-m1
- native-build-linux-x86-64
- native-build-linux-arm64
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download arithmetic
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: arithmetic-native-build-artifacts-linux-x86-64
path: arithmetic/build/
- name: Download arithmetic
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: arithmetic-native-build-artifacts-linux-arm64
path: arithmetic/build/
- name: Download arithmetic
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: arithmetic-native-build-artifacts-macos-x86-64
path: arithmetic/build/
- name: Download arithmetic
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: arithmetic-native-build-artifacts-macos-arm64
path: arithmetic/build/
- name: Download blake2bf
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: blake2bf-native-build-artifacts-linux-x86-64
path: blake2bf/build/
# blake2bf is not built for linux-arm64
# - name: Download blake2bf
# uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
# with:
# name: blake2bf-native-build-artifacts-linux-arm64
# path: blake2bf/build/
- name: Download blake2bf
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: blake2bf-native-build-artifacts-macos-x86-64
path: blake2bf/build/
# blake2bf is not built for macos-arm64
# - name: Download blake2bf
# uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
# with:
# name: blake2bf-native-build-artifacts-macos-arm64
# path: blake2bf/build/
- name: Download secp256k1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256k1-native-build-artifacts-linux-x86-64
path: secp256k1/build/
- name: Download secp256k1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256k1-native-build-artifacts-linux-arm64
path: secp256k1/build/
- name: Download secp256k1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256k1-native-build-artifacts-macos-x86-64
path: secp256k1/build/
- name: Download secp256k1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256k1-native-build-artifacts-macos-arm64
path: secp256k1/build/
- name: Download secp256r1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256r1-native-build-artifacts-linux-x86-64
path: secp256r1/besu-native-ec/release/
- name: Download secp256r1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256r1-native-build-artifacts-linux-arm64
path: secp256r1/besu-native-ec/release/
- name: Download secp256r1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256r1-native-build-artifacts-macos-x86-64
path: secp256r1/besu-native-ec/release/
- name: Download secp256r1
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: secp256r1-native-build-artifacts-macos-arm64
path: secp256r1/besu-native-ec/release/
- name: Download gnark
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: gnark-native-build-artifacts-linux-x86-64
path: gnark/build/
- name: Download gnark
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: gnark-native-build-artifacts-linux-arm64
path: gnark/build/
- name: Download gnark
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: gnark-native-build-artifacts-macos-x86-64
path: gnark/build/
- name: Download gnark
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: gnark-native-build-artifacts-macos-arm64
path: gnark/build/
- name: Download constantine
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: constantine-native-build-artifacts-linux-x86-64
path: constantine/build/
- name: Download constantine
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: constantine-native-build-artifacts-linux-arm64
path: constantine/build/
- name: Download constantine
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: constantine-native-build-artifacts-macos-x86-64
path: constantine/build/
- name: Download constantine
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: constantine-native-build-artifacts-macos-arm64
path: constantine/build/
- name: Download boringssl
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: boringssl-native-build-artifacts-linux-x86-64
path: boringssl/build/
- name: Download boringssl
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: boringssl-native-build-artifacts-linux-arm64
path: boringssl/build/
- name: Download boringssl
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: boringssl-native-build-artifacts-macos-x86-64
path: boringssl/build/
- name: Download boringssl
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: boringssl-native-build-artifacts-macos-arm64
path: boringssl/build/
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: adopt
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- name: Execute Gradle Build
run: ./gradlew --no-daemon --parallel build --scan
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-arithmetic
path: arithmetic/build/libs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-blake2bf
path: blake2bf/build/libs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-secp256k1
path: secp256k1/build/libs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-secp256r1
path: secp256r1/build/libs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-gnark
path: gnark/build/libs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-constantine
path: constantine/build/libs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-boringssl
path: boringssl/build/libs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jars-common
path: common/build/libs
- name: gradle publish
if: contains('refs/heads/release-', github.ref) || github.ref == 'refs/heads/main'
env:
ARTIFACTORY_USER: ${{ secrets.BESU_ARTIFACTORY_USER }}
ARTIFACTORY_KEY: ${{ secrets.BESU_ARTIFACTORY_TOKEN }}
run: ./gradlew --no-daemon --parallel publish artifactoryPublish --scan