name: Build Circuits on: push: tags: - "circom_circuits-v*.*.*" workflow_dispatch: inputs: tag: description: "Tag to release. Must follow the format of 'circom_circuits-vX.Y.Z'." required: true jobs: setup: name: Configure Environment runs-on: ubuntu-latest outputs: version: ${{ steps.define-version.outputs.version }} tag: ${{ steps.define-version.outputs.tag }} steps: - name: Define version id: define-version env: # Use the tag name if it is available, otherwise use the input version. # If neither is available, default to the commit hash. TAG: ${{ (github.ref_type == 'tag' && github.ref_name) || inputs.tag || '' }} run: | if [ -z "$TAG" ]; then echo "Could not determine tag." exit 1 elif [[ ! "$TAG" =~ ^circom_circuits-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "TAG must follow the format of 'circom_circuits-vX.Y.Z'. Value: '$VERSION'." exit 2 fi # Parse Version: Take only the vX.Y.Z part. VERSION=$(echo $TAG | cut -d'-' -f2) # Export the tag and version. echo "tag=$TAG" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT build-linux: name: Build Linux Binaries (Native) runs-on: ubuntu-latest needs: - setup env: VERSION: ${{ needs.setup.outputs.version }} OS: linux ARCH: x86_64 steps: - name: Install Rust Toolchain uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 with: toolchain: stable cache: false - name: Install Circom run: | git clone https://github.com/iden3/circom.git cd circom RUSTFLAGS="-A dead_code" cargo build --release RUSTFLAGS="-A dead_code" cargo install --path circom circom --version - name: Checkout uses: actions/checkout@8edcb1bdb4e267140fa742c62e395cd74f332709 with: path: repo - name: Initialise Submodules working-directory: repo run: git submodule update --init --recursive - name: Setup Dependencies working-directory: repo/circom_circuits/rapidsnark run: sudo apt update -y - name: Install Dependencies [Prover] run: sudo apt install -y build-essential cmake libgmp-dev libsodium-dev nasm curl m4 - name: Install Dependencies [Witness Generator] run: sudo apt install nlohmann-json3-dev - name: Replace Prover Makefile # TODO: Make a fork generate the appropriate Linux Makefile working-directory: repo run: cp .github/resources/prover/Makefile circom_circuits/rapidsnark/Makefile - name: Compile Prover and Verifier working-directory: repo/circom_circuits/rapidsnark run: | ./build_gmp.sh host make host_linux_x86_64_static - name: Generate PoL working-directory: repo/circom_circuits/Mantle run: circom --c --r1cs --no_asm --O2 pol.circom - name: Replace PoL Makefile # TODO: Make a fork generate the appropriate Linux Makefile working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile - name: Compile PoL working-directory: repo/circom_circuits/Mantle/pol_cpp run: make PROJECT=pol linux - name: Generate PoQ working-directory: repo/circom_circuits/Blend run: circom --c --r1cs --no_asm --O2 poq.circom - name: Replace PoQ Makefile # TODO: Make a fork generate the appropriate Linux Makefile working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Blend/poq_cpp/Makefile - name: Compile PoQ working-directory: repo/circom_circuits/Blend/poq_cpp run: make PROJECT=poq linux - name: Generate ZKSign working-directory: repo/circom_circuits/Mantle run: circom --c --r1cs --no_asm --O2 signature.circom - name: Replace ZKSign Makefile # TODO: Make a fork generate the appropriate Linux Makefile working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/signature_cpp/Makefile - name: Compile ZKSign working-directory: repo/circom_circuits/Mantle/signature_cpp run: make PROJECT=signature linux - name: Bundle Rapidsnark Prover working-directory: repo env: BINARY_NAME: prover BUNDLE_NAME: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} RAPIDSNARK_DIR: circom_circuits/rapidsnark/package run: | BUNDLE_DIR="${BUNDLE_NAME}/${BINARY_NAME}" mkdir -p "$BUNDLE_DIR" mv "${RAPIDSNARK_DIR}"/bin/${BINARY_NAME} "$BUNDLE_DIR/" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle Rapidsnark Verifier working-directory: repo env: BINARY_NAME: verifier BUNDLE_NAME: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} RAPIDSNARK_DIR: circom_circuits/rapidsnark/package run: | BUNDLE_DIR="${BUNDLE_NAME}/${BINARY_NAME}" mkdir -p "$BUNDLE_DIR" mv "${RAPIDSNARK_DIR}"/bin/${BINARY_NAME} "$BUNDLE_DIR/" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle PoL Witness Generator working-directory: repo env: CIRCUIT_NAME: pol PLATFORM_BINARY_NAME: pol BUNDLE_NAME: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Mantle/pol_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" ls -la ${WITNESS_GENERATOR_DIR} mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle PoQ Witness Generator working-directory: repo env: CIRCUIT_NAME: poq PLATFORM_BINARY_NAME: poq BUNDLE_NAME: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Blend/poq_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle ZKSign Witness Generator working-directory: repo env: CIRCUIT_NAME: signature PLATFORM_BINARY_NAME: zksign BUNDLE_NAME: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Mantle/signature_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Upload Rapidsnark Prover uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload Rapidsnark Verifier uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload PoL Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload PoQ Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload ZKSign Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz build-windows: name: Build Windows Binaries (Native) runs-on: windows-latest needs: - setup env: VERSION: ${{ needs.setup.outputs.version }} OS: windows ARCH: x86_64 steps: - name: Setup MSYS2 uses: msys2/setup-msys2@v2.28.0 # FIXME: Ideally use the hash to avoid supply chain attacks. Currently unable to. with: update: true install: >- base-devel mingw-w64-x86_64-toolchain make git - name: Install Rust Toolchain uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 with: toolchain: stable cache: false - name: Install Circom run: | git clone https://github.com/iden3/circom.git cd circom $env:RUSTFLAGS="-A dead_code"; cargo build --release $env:RUSTFLAGS="-A dead_code"; cargo install --path circom circom --version - name: Checkout uses: actions/checkout@8edcb1bdb4e267140fa742c62e395cd74f332709 with: path: repo - name: Initialise Submodules working-directory: repo run: git submodule update --init --recursive - name: Install Dependencies [Witness Generator] shell: msys2 {0} run: | # nlohmann/json mkdir -p /include/nlohmann/ wget -O /include/nlohmann/json.hpp https://github.com/nlohmann/json/releases/download/v3.12.0/json.hpp # mman-win32 git clone https://github.com/alitrack/mman-win32.git pushd mman-win32 ./configure --prefix= # Path: / make make install popd - name: Install Dependencies [Prover] shell: msys2 {0} run: pacman --noconfirm -Sy --needed cmake nasm mingw-w64-ucrt-x86_64-libsodium - name: Replace Prover Makefile # TODO: Make a fork generate the appropriate Windows Makefile shell: msys2 {0} working-directory: repo run: cp .github/resources/prover/Makefile circom_circuits/rapidsnark/Makefile - name: Replace Prover CMakeLists shell: msys2 {0} working-directory: repo run: cp .github/resources/prover/${{ env.OS }}.src-CMakeLists.txt circom_circuits/rapidsnark/src/CMakeLists.txt - name: Patch Windows mman shell: msys2 {0} working-directory: repo run: cp .github/resources/prover/${{ env.OS }}.mman_patch.hpp /include/mman_patch.hpp - name: Add uio.h headers shell: msys2 {0} working-directory: repo run: cp .github/resources/prover/${{ env.OS }}.uio.h /include/sys/uio.h - name: Replace build_gmp shell: msys2 {0} working-directory: repo run: cp .github/resources/prover/${{ env.OS }}.build_gmp.sh circom_circuits/rapidsnark/build_gmp.sh - name: Compile Prover and Verifier shell: msys2 {0} working-directory: repo/circom_circuits/rapidsnark run: | ./build_gmp.sh host make host_windows_x86_64_static - name: Generate PoL working-directory: repo/circom_circuits/Mantle run: circom --c --r1cs --no_asm pol.circom - name: Replace PoL Makefile # TODO: Make a fork generate the appropriate Windows Makefile shell: msys2 {0} working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile - name: Compile PoL shell: msys2 {0} working-directory: repo/circom_circuits/Mantle/pol_cpp run: make PROJECT=pol windows - name: Generate PoQ working-directory: repo/circom_circuits/Blend run: circom --c --r1cs --no_asm poq.circom - name: Replace PoQ Makefile # TODO: Make a fork generate the appropriate Windows Makefile shell: msys2 {0} working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Blend/poq_cpp/Makefile - name: Compile PoQ shell: msys2 {0} working-directory: repo/circom_circuits/Blend/poq_cpp run: make PROJECT=poq windows - name: Generate ZKSign working-directory: repo/circom_circuits/Mantle run: circom --c --r1cs --no_asm signature.circom - name: Replace ZKSign Makefile # TODO: Make a fork generate the appropriate Windows Makefile shell: msys2 {0} working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/signature_cpp/Makefile - name: Compile ZKSign shell: msys2 {0} working-directory: repo/circom_circuits/Mantle/signature_cpp run: make PROJECT=signature windows - name: Bundle Rapidsnark Prover shell: msys2 {0} working-directory: repo env: BINARY_NAME: prover BUNDLE_NAME: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} RAPIDSNARK_DIR: circom_circuits/rapidsnark/package run: | BUNDLE_DIR="${BUNDLE_NAME}/${BINARY_NAME}" mkdir -p "$BUNDLE_DIR" mv "${RAPIDSNARK_DIR}"/bin/${BINARY_NAME}.exe "$BUNDLE_DIR/" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle Rapidsnark Verifier shell: msys2 {0} working-directory: repo env: BINARY_NAME: verifier BUNDLE_NAME: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} RAPIDSNARK_DIR: circom_circuits/rapidsnark/package run: | BUNDLE_DIR="${BUNDLE_NAME}/${BINARY_NAME}" mkdir -p "$BUNDLE_DIR" mv "${RAPIDSNARK_DIR}"/bin/${BINARY_NAME}.exe "$BUNDLE_DIR/" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle PoL Witness Generator shell: msys2 {0} working-directory: repo env: CIRCUIT_NAME: pol PLATFORM_BINARY_NAME: pol.exe BUNDLE_NAME: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Mantle/pol_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle PoQ Witness Generator shell: msys2 {0} working-directory: repo env: CIRCUIT_NAME: poq PLATFORM_BINARY_NAME: poq.exe BUNDLE_NAME: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Blend/poq_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle ZKSign Witness Generator shell: msys2 {0} working-directory: repo env: CIRCUIT_NAME: signature PLATFORM_BINARY_NAME: zksign.exe BUNDLE_NAME: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Mantle/signature_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Upload Rapidsnark Prover uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload Rapidsnark Verifier uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload PoL Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload PoQ Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload ZKSign Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz build-macos: name: Build MacOS Binaries (Native) runs-on: macos-latest needs: - setup env: VERSION: ${{ needs.setup.outputs.version }} ARCH: arm64 OS: macos steps: - name: Install Rust Toolchain uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 with: toolchain: stable cache: false - name: Install Circom run: | git clone https://github.com/iden3/circom.git cd circom RUSTFLAGS="-A dead_code" cargo build --release RUSTFLAGS="-A dead_code" cargo install --path circom circom --version - name: Checkout uses: actions/checkout@8edcb1bdb4e267140fa742c62e395cd74f332709 with: path: repo - name: Initialise Submodules working-directory: repo run: git submodule update --init --recursive - name: Setup Dependencies run: mkdir include - name: Install Dependencies [Witness Generator] run: brew install nlohmann-json - name: Install Dependencies [Prover] run: brew install nasm m4 - name: Compile Prover and Verifier working-directory: repo/circom_circuits/rapidsnark run: | ./build_gmp.sh macos_arm64 make macos_arm64 - name: Generate PoL working-directory: repo/circom_circuits/Mantle run: circom --c --r1cs --no_asm --O2 pol.circom - name: Replace PoL's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile - name: Patch MacOS GMP working-directory: repo run: cp .github/resources/witness-generator/${{ env.OS }}.gmp_patch.hpp circom_circuits/Mantle/pol_cpp/gmp_patch.hpp - name: Compile PoL working-directory: repo/circom_circuits/Mantle/pol_cpp run: make PROJECT=pol macos - name: Generate PoQ working-directory: repo/circom_circuits/Blend run: circom --c --r1cs --no_asm --O2 poq.circom - name: Replace PoQ's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Blend/poq_cpp/Makefile - name: Patch MacOS GMP working-directory: repo run: cp .github/resources/witness-generator/${{ env.OS }}.gmp_patch.hpp circom_circuits/Blend/poq_cpp/gmp_patch.hpp - name: Compile PoQ working-directory: repo/circom_circuits/Blend/poq_cpp run: make PROJECT=poq macos - name: Generate ZKSign working-directory: repo/circom_circuits/Mantle run: circom --c --r1cs --no_asm --O2 signature.circom - name: Replace ZKSign's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile working-directory: repo run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/signature_cpp/Makefile - name: Patch MacOS GMP working-directory: repo run: cp .github/resources/witness-generator/${{ env.OS }}.gmp_patch.hpp circom_circuits/Mantle/signature_cpp/gmp_patch.hpp - name: Compile ZKSign working-directory: repo/circom_circuits/Mantle/signature_cpp run: make PROJECT=signature macos - name: Bundle Rapidsnark Prover working-directory: repo env: BINARY_NAME: prover BUNDLE_NAME: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} RAPIDSNARK_DIR: circom_circuits/rapidsnark/package_macos_arm64 run: | BUNDLE_DIR="${BUNDLE_NAME}/${BINARY_NAME}" mkdir -p "$BUNDLE_DIR" mv "${RAPIDSNARK_DIR}/bin/${BINARY_NAME}" "$BUNDLE_DIR/" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle Rapidsnark Verifier working-directory: repo env: BINARY_NAME: verifier BUNDLE_NAME: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} RAPIDSNARK_DIR: circom_circuits/rapidsnark/package_macos_arm64 run: | BUNDLE_DIR="${BUNDLE_NAME}/${BINARY_NAME}" mkdir -p "$BUNDLE_DIR" mv "${RAPIDSNARK_DIR}/bin/${BINARY_NAME}" "$BUNDLE_DIR/" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle PoL Witness Generator working-directory: repo env: CIRCUIT_NAME: pol PLATFORM_BINARY_NAME: pol BUNDLE_NAME: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Mantle/pol_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" ls -la ${WITNESS_GENERATOR_DIR} mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle PoQ Witness Generator working-directory: repo env: CIRCUIT_NAME: poq PLATFORM_BINARY_NAME: poq BUNDLE_NAME: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Blend/poq_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Bundle ZKSign Witness Generator working-directory: repo env: CIRCUIT_NAME: signature PLATFORM_BINARY_NAME: zksign BUNDLE_NAME: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }} WITNESS_GENERATOR_DIR: circom_circuits/Mantle/signature_cpp run: | BUNDLE_DIR="${BUNDLE_NAME}/witness-generator" mkdir -p "$BUNDLE_DIR" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}" mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat" tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}" - name: Upload Rapidsnark Prover uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload Rapidsnark Verifier uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload PoL Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload PoQ Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz - name: Upload ZKSign Witness Generator uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 with: name: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz path: repo/zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz publish-release: name: Create Release runs-on: ubuntu-latest needs: - setup - build-linux - build-windows - build-macos env: TAG: ${{ needs.setup.outputs.tag }} VERSION: ${{ needs.setup.outputs.version }} outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - name: Create Release uses: actions/create-release@4c11c9fe1dcd9636620a16455165783b20fc7ea0 id: create_release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ env.TAG }} release_name: Circom Circuits ${{ env.VERSION }} body: | This is a release of Circom Circuits ${{ env.VERSION }}. ## Changelog - feature(X): new feature - fix(Y): bug description - feature: performance improvement on Z ## Checklist Before publishing please ensure: - [ ] Description is complete - [ ] Changelog is correct - [ ] Assets for all platforms exist - [ ] Pre-release is checked if necessary - [ ] Remove this checklist before publishing the release. draft: true prerelease: true upload-artifacts: name: Upload Artifacts to Release runs-on: ubuntu-latest needs: - setup - publish-release strategy: fail-fast: false matrix: platform: - os: linux arch: x86_64 - os: macos arch: arm64 - os: windows arch: x86_64 artifact: - prover - verifier - pol - poq - zksign env: UPLOAD_URL: ${{ needs.publish-release.outputs.upload_url }} ARTIFACT_NAME: ${{ matrix.artifact }}-${{ needs.setup.outputs.version }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.tar.gz steps: - name: Download Artifacts uses: actions/download-artifact@448e3f862ab3ef47aa50ff917776823c9946035b with: name: ${{ env.ARTIFACT_NAME }} - name: Upload Artifacts to Release uses: actions/upload-release-asset@ef2adfe8cb8ebfa540930c452c576b3819990faa env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ env.UPLOAD_URL }} asset_path: ${{ env.ARTIFACT_NAME }} asset_name: ${{ env.ARTIFACT_NAME }} asset_content_type: application/octet-stream