mirror of
https://github.com/logos-blockchain/logos-blockchain-pocs.git
synced 2026-02-03 20:53:09 +00:00
139 lines
3.7 KiB
YAML
139 lines
3.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request: # For testing purposes
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build Linux Binary
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Rust Toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
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@v4
|
|
with:
|
|
path: repo
|
|
|
|
- name: Initialise Submodules
|
|
working-directory: repo
|
|
run: |
|
|
git submodule update --init --recursive
|
|
|
|
- name: Generate C++ Circuit
|
|
working-directory: repo/circom_circuits/Mantle
|
|
run: |
|
|
circom --c --r1cs --no_asm pol.circom
|
|
|
|
- name: Install Circuit Dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install nlohmann-json3-dev
|
|
|
|
- name: Compile Circuit
|
|
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
|
run: |
|
|
make pol
|
|
|
|
- name: Upload Binary
|
|
uses: actions/upload-artifact@v4
|
|
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
|
with:
|
|
name: pol
|
|
path: pol
|
|
|
|
build-windows-native:
|
|
name: Build Windows Binary (Native)
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Install Rust Toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
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@v4
|
|
with:
|
|
path: repo
|
|
|
|
- name: Initialise Submodules
|
|
working-directory: repo
|
|
run: |
|
|
git submodule update --init --recursive
|
|
|
|
- name: Generate C++ Circuit
|
|
working-directory: repo/circom_circuits/Mantle
|
|
run: |
|
|
circom --c --r1cs --no_asm pol.circom
|
|
|
|
- name: Setup MSYS2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
update: true
|
|
install: >-
|
|
base-devel
|
|
mingw-w64-x86_64-toolchain
|
|
make
|
|
git
|
|
|
|
- name: Dependencies - Setup
|
|
shell: msys2 {0}
|
|
run: mkdir /include
|
|
|
|
- name: Dependencies - Install [mman-win32]
|
|
shell: msys2 {0}
|
|
run: |
|
|
git clone https://github.com/alitrack/mman-win32.git
|
|
cd mman-win32
|
|
pwd
|
|
./configure --prefix= # Path: /
|
|
make
|
|
make install
|
|
|
|
- name: Dependencies - Install [nlohmann/json]
|
|
shell: msys2 {0}
|
|
run: |
|
|
mkdir -p /include/nlohmann/
|
|
wget -O /include/nlohmann/json.hpp https://github.com/nlohmann/json/releases/download/v3.12.0/json.hpp
|
|
|
|
- name: Replace pol Makefile # TODO: Make a fork generate the appropriate Windows Makefile
|
|
working-directory: repo
|
|
shell: msys2 {0}
|
|
run: cp .github/resources/Makefile.windows circom_circuits/Mantle/pol_cpp/Makefile
|
|
|
|
- name: Compile Circuit
|
|
shell: msys2 {0}
|
|
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
|
run: |
|
|
make pol.exe
|
|
|
|
- name: Upload Binary
|
|
uses: actions/upload-artifact@v4
|
|
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
|
with:
|
|
name: pol.exe
|
|
path: pol.exe
|