From 4d0dd53f08a356d02dbcadd2c16bc543abadf517 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 8 Feb 2024 14:57:04 -0500 Subject: [PATCH 1/6] Update publish-bb.yml --- .github/workflows/publish-bb.yml | 376 +++++++++++++++---------------- 1 file changed, 188 insertions(+), 188 deletions(-) diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index 6793f999745c..3556e518aa55 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -19,125 +19,125 @@ permissions: contents: write jobs: - build-x86_64-linux-gnu: - name: Build on Linux GNU - runs-on: ubuntu-20.04 - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - ref: ${{ inputs.tag || env.GITHUB_REF }} - - - name: Install bleeding edge cmake - run: | - sudo apt -y remove --purge cmake - sudo snap install cmake --classic - - - name: Create Build Environment - run: | - sudo apt-get update - sudo apt-get -y install ninja-build - - - name: Install Clang16 - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ - - - name: Compile Barretenberg - run: | - cd barretenberg/cpp - - cmake --preset default -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=RelWithAssert -DTARGET_ARCH=westmere - cmake --build --preset default --target bb - - - name: Tar and GZip bb Binary (Ubuntu) - working-directory: barretenberg/cpp/build/bin - run: tar -cvzf barretenberg-x86_64-linux-gnu.tar.gz bb - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: release-linux - path: | - ./barretenberg/cpp/build/bin/barretenberg-x86_64-linux-gnu.tar.gz - - build-wasm-ts: - name: Build WASM and deploy to TS - runs-on: ubuntu-20.04 - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - ref: ${{ inputs.tag || env.GITHUB_REF }} - - - name: Install bleeding edge cmake - run: | - sudo apt -y remove --purge cmake - sudo snap install cmake --classic - - - name: Create Build Environment - run: | - sudo apt-get update - sudo apt-get -y install ninja-build yarn - - - name: Install Clang16 - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ - - - name: Install yarn # Needed to call 'yarn build' on barretenberg/ts - run: | - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - sudo apt -y update && sudo apt -y install yarn - - name: Install WASI-SDK - run: | - cd barretenberg/cpp - - ./scripts/install-wasi-sdk.sh - - - name: Compile Typescript # Compiles bb.js and wasms - run: | - cd barretenberg/ts - yarn install && yarn && yarn build - - - name: Tar and GZip barretenberg.wasm - working-directory: barretenberg/cpp/build-wasm/bin - run: tar -cvzf barretenberg.wasm.tar.gz barretenberg.wasm - - - name: Tar and GZip acvm_backend.wasm - working-directory: barretenberg/cpp/build-wasm/bin - run: tar -cvzf acvm_backend.wasm.tar.gz acvm_backend.wasm - - # - name: Setup Node.js - # uses: actions/setup-node@v2 - # with: - # node-version: "18" - # registry-url: "https://registry.npmjs.org" - - # - name: Deploy Typescript to NPM - # if: github.event.inputs.tag != 'nightly' && github.event.inputs.tag != '' # Do not deploy to npm if it is a nightly build - # run: | - # cd barretenberg/ts - # yarn deploy - # env: - # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: release-wasm - path: | - ./barretenberg/cpp/build-wasm/bin/barretenberg.wasm.tar.gz - ./barretenberg/cpp/build-wasm/bin/acvm_backend.wasm.tar.gz + # build-x86_64-linux-gnu: + # name: Build on Linux GNU + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout Code + # uses: actions/checkout@v3 + # with: + # ref: ${{ inputs.tag || env.GITHUB_REF }} + + # - name: Install bleeding edge cmake + # run: | + # sudo apt -y remove --purge cmake + # sudo snap install cmake --classic + + # - name: Create Build Environment + # run: | + # sudo apt-get update + # sudo apt-get -y install ninja-build + + # - name: Install Clang16 + # run: | + # wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + # tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + # sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ + # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ + # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ + # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ + + # - name: Compile Barretenberg + # run: | + # cd barretenberg/cpp + + # cmake --preset default -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=RelWithAssert -DTARGET_ARCH=westmere + # cmake --build --preset default --target bb + + # - name: Tar and GZip bb Binary (Ubuntu) + # working-directory: barretenberg/cpp/build/bin + # run: tar -cvzf barretenberg-x86_64-linux-gnu.tar.gz bb + + # - name: Upload artifacts + # uses: actions/upload-artifact@v2 + # with: + # name: release-linux + # path: | + # ./barretenberg/cpp/build/bin/barretenberg-x86_64-linux-gnu.tar.gz + + # build-wasm-ts: + # name: Build WASM and deploy to TS + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout Code + # uses: actions/checkout@v3 + # with: + # ref: ${{ inputs.tag || env.GITHUB_REF }} + + # - name: Install bleeding edge cmake + # run: | + # sudo apt -y remove --purge cmake + # sudo snap install cmake --classic + + # - name: Create Build Environment + # run: | + # sudo apt-get update + # sudo apt-get -y install ninja-build yarn + + # - name: Install Clang16 + # run: | + # wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + # tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + # sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ + # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ + # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ + # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ + + # - name: Install yarn # Needed to call 'yarn build' on barretenberg/ts + # run: | + # curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - + # echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + # sudo apt -y update && sudo apt -y install yarn + # - name: Install WASI-SDK + # run: | + # cd barretenberg/cpp + + # ./scripts/install-wasi-sdk.sh + + # - name: Compile Typescript # Compiles bb.js and wasms + # run: | + # cd barretenberg/ts + # yarn install && yarn && yarn build + + # - name: Tar and GZip barretenberg.wasm + # working-directory: barretenberg/cpp/build-wasm/bin + # run: tar -cvzf barretenberg.wasm.tar.gz barretenberg.wasm + + # - name: Tar and GZip acvm_backend.wasm + # working-directory: barretenberg/cpp/build-wasm/bin + # run: tar -cvzf acvm_backend.wasm.tar.gz acvm_backend.wasm + + # # - name: Setup Node.js + # # uses: actions/setup-node@v2 + # # with: + # # node-version: "18" + # # registry-url: "https://registry.npmjs.org" + + # # - name: Deploy Typescript to NPM + # # if: github.event.inputs.tag != 'nightly' && github.event.inputs.tag != '' # Do not deploy to npm if it is a nightly build + # # run: | + # # cd barretenberg/ts + # # yarn deploy + # # env: + # # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + # - name: Upload artifacts + # uses: actions/upload-artifact@v2 + # with: + # name: release-wasm + # path: | + # ./barretenberg/cpp/build-wasm/bin/barretenberg.wasm.tar.gz + # ./barretenberg/cpp/build-wasm/bin/acvm_backend.wasm.tar.gz build-mac-intel: name: Build on Mac x86_64-apple-darwin @@ -171,72 +171,72 @@ jobs: path: ./barretenberg/cpp/build/bin/barretenberg-x86_64-apple-darwin.tar.gz retention-days: 3 - build-mac-m1: - name: Build on Mac aarch64-apple-darwin - runs-on: macos-14 - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ inputs.tag || env.GITHUB_REF }} - - - name: Create Mac Build Environment - run: brew install cmake ninja - - - name: Compile Barretenberg - working-directory: barretenberg/cpp - run: | - cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert - cmake --build --preset default --target bb - - - name: Package barretenberg artifact - working-directory: barretenberg/cpp/build/bin - run: | - mkdir dist - cp ./bb ./dist/bb - 7z a -ttar -so -an ./dist/* | 7z a -si ./barretenberg-aarch64-apple-darwin.tar.gz - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: barretenberg-aarch64-apple-darwin - path: ./barretenberg/cpp/build/bin/barretenberg-aarch64-apple-darwin.tar.gz - retention-days: 3 - - release: - name: Publish - needs: [build-x86_64-linux-gnu, build-mac-intel, build-mac-m1,build-wasm-ts] - runs-on: ubuntu-latest - steps: - - name: Download files from Linux Runner - uses: actions/download-artifact@v2 - with: - name: release-linux - - - name: Download files for WASM - uses: actions/download-artifact@v2 - with: - name: release-wasm - - - name: Download files from x86_64 Mac Runner - uses: actions/download-artifact@v2 - with: - name: barretenberg-x86_64-apple-darwin - - - name: Download files from aarch64 Mac Runner - uses: actions/download-artifact@v2 - with: - name: barretenberg-aarch64-apple-darwin - - - name: Publish to GitHub - uses: softprops/action-gh-release@v1 - if: ${{ inputs.publish || github.event_name == 'schedule' }} - with: - tag_name: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) - prerelease: true - files: | - barretenberg.wasm.tar.gz - acvm_backend.wasm.tar.gz - barretenberg-x86_64-linux-gnu.tar.gz - barretenberg-x86_64-apple-darwin.tar.gz - barretenberg-aarch64-apple-darwin.tar.gz + # build-mac-m1: + # name: Build on Mac aarch64-apple-darwin + # runs-on: macos-14 + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + # with: + # ref: ${{ inputs.tag || env.GITHUB_REF }} + + # - name: Create Mac Build Environment + # run: brew install cmake ninja + + # - name: Compile Barretenberg + # working-directory: barretenberg/cpp + # run: | + # cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert + # cmake --build --preset default --target bb + + # - name: Package barretenberg artifact + # working-directory: barretenberg/cpp/build/bin + # run: | + # mkdir dist + # cp ./bb ./dist/bb + # 7z a -ttar -so -an ./dist/* | 7z a -si ./barretenberg-aarch64-apple-darwin.tar.gz + + # - name: Upload artifact + # uses: actions/upload-artifact@v3 + # with: + # name: barretenberg-aarch64-apple-darwin + # path: ./barretenberg/cpp/build/bin/barretenberg-aarch64-apple-darwin.tar.gz + # retention-days: 3 + + # release: + # name: Publish + # needs: [build-x86_64-linux-gnu, build-mac-intel, build-mac-m1,build-wasm-ts] + # runs-on: ubuntu-latest + # steps: + # - name: Download files from Linux Runner + # uses: actions/download-artifact@v2 + # with: + # name: release-linux + + # - name: Download files for WASM + # uses: actions/download-artifact@v2 + # with: + # name: release-wasm + + # - name: Download files from x86_64 Mac Runner + # uses: actions/download-artifact@v2 + # with: + # name: barretenberg-x86_64-apple-darwin + + # - name: Download files from aarch64 Mac Runner + # uses: actions/download-artifact@v2 + # with: + # name: barretenberg-aarch64-apple-darwin + + # - name: Publish to GitHub + # uses: softprops/action-gh-release@v1 + # if: ${{ inputs.publish || github.event_name == 'schedule' }} + # with: + # tag_name: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + # prerelease: true + # files: | + # barretenberg.wasm.tar.gz + # acvm_backend.wasm.tar.gz + # barretenberg-x86_64-linux-gnu.tar.gz + # barretenberg-x86_64-apple-darwin.tar.gz + # barretenberg-aarch64-apple-darwin.tar.gz From acb795255f3d109ac0332f79672b44a38f224d10 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 8 Feb 2024 15:02:29 -0500 Subject: [PATCH 2/6] Update publish-bb.yml --- .github/workflows/publish-bb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index 3556e518aa55..363909d95766 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -149,7 +149,7 @@ jobs: ref: ${{ inputs.tag || env.GITHUB_REF }} - name: Create Mac Build Environment - run: brew install cmake ninja + run: brew install cmake ninja llvm@16 - name: Compile Barretenberg working-directory: barretenberg/cpp From 5c2d1abf31d88167cd80db1af149c80f514cacc6 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 8 Feb 2024 15:04:11 -0500 Subject: [PATCH 3/6] try --- .github/workflows/publish-bb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index 363909d95766..f757768a6d5b 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -149,7 +149,7 @@ jobs: ref: ${{ inputs.tag || env.GITHUB_REF }} - name: Create Mac Build Environment - run: brew install cmake ninja llvm@16 + run: brew install cmake ninja && softwareupdate --all --install --force - name: Compile Barretenberg working-directory: barretenberg/cpp From b4564790af2fc33f7e661773b73382c59ce0b453 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 8 Feb 2024 15:10:19 -0500 Subject: [PATCH 4/6] fix: publish-bb.yml --- .github/workflows/publish-bb.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index f757768a6d5b..e691fcdb4770 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -149,13 +149,13 @@ jobs: ref: ${{ inputs.tag || env.GITHUB_REF }} - name: Create Mac Build Environment - run: brew install cmake ninja && softwareupdate --all --install --force + run: brew install cmake ninja llvm@16 - name: Compile Barretenberg working-directory: barretenberg/cpp run: | - cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert - cmake --build --preset default --target bb + cmake -DCMAKE_C_COMPILER=$(brew --prefix llvm)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++ -DCMAKE_BUILD_TYPE=RelWithAssert --preset default + cmake --build build --target bb - name: Package barretenberg artifact working-directory: barretenberg/cpp/build/bin From 58b8009e1e9c3ee22445b9408a89fa1cade73bda Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 8 Feb 2024 15:15:25 -0500 Subject: [PATCH 5/6] wiring --- .github/workflows/publish-bb.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index e691fcdb4770..258361abfd58 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -154,8 +154,11 @@ jobs: - name: Compile Barretenberg working-directory: barretenberg/cpp run: | - cmake -DCMAKE_C_COMPILER=$(brew --prefix llvm)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++ -DCMAKE_BUILD_TYPE=RelWithAssert --preset default - cmake --build build --target bb + export PATH="/usr/local/opt/llvm@16/bin:$PATH" + export LDFLAGS="-L/usr/local/opt/llvm@16/lib" + export CPPFLAGS="-I/usr/local/opt/llvm@16/include" + cmake -DCMAKE_BUILD_TYPE=RelWithAssert --preset default + cmake --build --preset default --target bb - name: Package barretenberg artifact working-directory: barretenberg/cpp/build/bin From a902cbdd76ad252fd297053919aadcfd5137dbe1 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 8 Feb 2024 15:19:54 -0500 Subject: [PATCH 6/6] back to working state --- .github/workflows/publish-bb.yml | 376 +++++++++++++++---------------- 1 file changed, 188 insertions(+), 188 deletions(-) diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index 258361abfd58..d295b9fdcf85 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -19,125 +19,125 @@ permissions: contents: write jobs: - # build-x86_64-linux-gnu: - # name: Build on Linux GNU - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout Code - # uses: actions/checkout@v3 - # with: - # ref: ${{ inputs.tag || env.GITHUB_REF }} - - # - name: Install bleeding edge cmake - # run: | - # sudo apt -y remove --purge cmake - # sudo snap install cmake --classic - - # - name: Create Build Environment - # run: | - # sudo apt-get update - # sudo apt-get -y install ninja-build - - # - name: Install Clang16 - # run: | - # wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - # tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - # sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ - # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ - # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ - # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ - - # - name: Compile Barretenberg - # run: | - # cd barretenberg/cpp - - # cmake --preset default -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=RelWithAssert -DTARGET_ARCH=westmere - # cmake --build --preset default --target bb - - # - name: Tar and GZip bb Binary (Ubuntu) - # working-directory: barretenberg/cpp/build/bin - # run: tar -cvzf barretenberg-x86_64-linux-gnu.tar.gz bb - - # - name: Upload artifacts - # uses: actions/upload-artifact@v2 - # with: - # name: release-linux - # path: | - # ./barretenberg/cpp/build/bin/barretenberg-x86_64-linux-gnu.tar.gz - - # build-wasm-ts: - # name: Build WASM and deploy to TS - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout Code - # uses: actions/checkout@v3 - # with: - # ref: ${{ inputs.tag || env.GITHUB_REF }} - - # - name: Install bleeding edge cmake - # run: | - # sudo apt -y remove --purge cmake - # sudo snap install cmake --classic - - # - name: Create Build Environment - # run: | - # sudo apt-get update - # sudo apt-get -y install ninja-build yarn - - # - name: Install Clang16 - # run: | - # wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - # tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - # sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ - # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ - # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ - # sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ - - # - name: Install yarn # Needed to call 'yarn build' on barretenberg/ts - # run: | - # curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - - # echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - # sudo apt -y update && sudo apt -y install yarn - # - name: Install WASI-SDK - # run: | - # cd barretenberg/cpp - - # ./scripts/install-wasi-sdk.sh - - # - name: Compile Typescript # Compiles bb.js and wasms - # run: | - # cd barretenberg/ts - # yarn install && yarn && yarn build - - # - name: Tar and GZip barretenberg.wasm - # working-directory: barretenberg/cpp/build-wasm/bin - # run: tar -cvzf barretenberg.wasm.tar.gz barretenberg.wasm - - # - name: Tar and GZip acvm_backend.wasm - # working-directory: barretenberg/cpp/build-wasm/bin - # run: tar -cvzf acvm_backend.wasm.tar.gz acvm_backend.wasm - - # # - name: Setup Node.js - # # uses: actions/setup-node@v2 - # # with: - # # node-version: "18" - # # registry-url: "https://registry.npmjs.org" - - # # - name: Deploy Typescript to NPM - # # if: github.event.inputs.tag != 'nightly' && github.event.inputs.tag != '' # Do not deploy to npm if it is a nightly build - # # run: | - # # cd barretenberg/ts - # # yarn deploy - # # env: - # # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - # - name: Upload artifacts - # uses: actions/upload-artifact@v2 - # with: - # name: release-wasm - # path: | - # ./barretenberg/cpp/build-wasm/bin/barretenberg.wasm.tar.gz - # ./barretenberg/cpp/build-wasm/bin/acvm_backend.wasm.tar.gz + build-x86_64-linux-gnu: + name: Build on Linux GNU + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + ref: ${{ inputs.tag || env.GITHUB_REF }} + + - name: Install bleeding edge cmake + run: | + sudo apt -y remove --purge cmake + sudo snap install cmake --classic + + - name: Create Build Environment + run: | + sudo apt-get update + sudo apt-get -y install ninja-build + + - name: Install Clang16 + run: | + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ + sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ + sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ + sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ + + - name: Compile Barretenberg + run: | + cd barretenberg/cpp + + cmake --preset default -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=RelWithAssert -DTARGET_ARCH=westmere + cmake --build --preset default --target bb + + - name: Tar and GZip bb Binary (Ubuntu) + working-directory: barretenberg/cpp/build/bin + run: tar -cvzf barretenberg-x86_64-linux-gnu.tar.gz bb + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: release-linux + path: | + ./barretenberg/cpp/build/bin/barretenberg-x86_64-linux-gnu.tar.gz + + build-wasm-ts: + name: Build WASM and deploy to TS + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + ref: ${{ inputs.tag || env.GITHUB_REF }} + + - name: Install bleeding edge cmake + run: | + sudo apt -y remove --purge cmake + sudo snap install cmake --classic + + - name: Create Build Environment + run: | + sudo apt-get update + sudo apt-get -y install ninja-build yarn + + - name: Install Clang16 + run: | + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ + sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ + sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ + sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ + + - name: Install yarn # Needed to call 'yarn build' on barretenberg/ts + run: | + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + sudo apt -y update && sudo apt -y install yarn + - name: Install WASI-SDK + run: | + cd barretenberg/cpp + + ./scripts/install-wasi-sdk.sh + + - name: Compile Typescript # Compiles bb.js and wasms + run: | + cd barretenberg/ts + yarn install && yarn && yarn build + + - name: Tar and GZip barretenberg.wasm + working-directory: barretenberg/cpp/build-wasm/bin + run: tar -cvzf barretenberg.wasm.tar.gz barretenberg.wasm + + - name: Tar and GZip acvm_backend.wasm + working-directory: barretenberg/cpp/build-wasm/bin + run: tar -cvzf acvm_backend.wasm.tar.gz acvm_backend.wasm + + # - name: Setup Node.js + # uses: actions/setup-node@v2 + # with: + # node-version: "18" + # registry-url: "https://registry.npmjs.org" + + # - name: Deploy Typescript to NPM + # if: github.event.inputs.tag != 'nightly' && github.event.inputs.tag != '' # Do not deploy to npm if it is a nightly build + # run: | + # cd barretenberg/ts + # yarn deploy + # env: + # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: release-wasm + path: | + ./barretenberg/cpp/build-wasm/bin/barretenberg.wasm.tar.gz + ./barretenberg/cpp/build-wasm/bin/acvm_backend.wasm.tar.gz build-mac-intel: name: Build on Mac x86_64-apple-darwin @@ -174,72 +174,72 @@ jobs: path: ./barretenberg/cpp/build/bin/barretenberg-x86_64-apple-darwin.tar.gz retention-days: 3 - # build-mac-m1: - # name: Build on Mac aarch64-apple-darwin - # runs-on: macos-14 - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # with: - # ref: ${{ inputs.tag || env.GITHUB_REF }} - - # - name: Create Mac Build Environment - # run: brew install cmake ninja - - # - name: Compile Barretenberg - # working-directory: barretenberg/cpp - # run: | - # cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert - # cmake --build --preset default --target bb - - # - name: Package barretenberg artifact - # working-directory: barretenberg/cpp/build/bin - # run: | - # mkdir dist - # cp ./bb ./dist/bb - # 7z a -ttar -so -an ./dist/* | 7z a -si ./barretenberg-aarch64-apple-darwin.tar.gz - - # - name: Upload artifact - # uses: actions/upload-artifact@v3 - # with: - # name: barretenberg-aarch64-apple-darwin - # path: ./barretenberg/cpp/build/bin/barretenberg-aarch64-apple-darwin.tar.gz - # retention-days: 3 - - # release: - # name: Publish - # needs: [build-x86_64-linux-gnu, build-mac-intel, build-mac-m1,build-wasm-ts] - # runs-on: ubuntu-latest - # steps: - # - name: Download files from Linux Runner - # uses: actions/download-artifact@v2 - # with: - # name: release-linux - - # - name: Download files for WASM - # uses: actions/download-artifact@v2 - # with: - # name: release-wasm - - # - name: Download files from x86_64 Mac Runner - # uses: actions/download-artifact@v2 - # with: - # name: barretenberg-x86_64-apple-darwin - - # - name: Download files from aarch64 Mac Runner - # uses: actions/download-artifact@v2 - # with: - # name: barretenberg-aarch64-apple-darwin - - # - name: Publish to GitHub - # uses: softprops/action-gh-release@v1 - # if: ${{ inputs.publish || github.event_name == 'schedule' }} - # with: - # tag_name: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) - # prerelease: true - # files: | - # barretenberg.wasm.tar.gz - # acvm_backend.wasm.tar.gz - # barretenberg-x86_64-linux-gnu.tar.gz - # barretenberg-x86_64-apple-darwin.tar.gz - # barretenberg-aarch64-apple-darwin.tar.gz + build-mac-m1: + name: Build on Mac aarch64-apple-darwin + runs-on: macos-14 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ inputs.tag || env.GITHUB_REF }} + + - name: Create Mac Build Environment + run: brew install cmake ninja + + - name: Compile Barretenberg + working-directory: barretenberg/cpp + run: | + cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert + cmake --build --preset default --target bb + + - name: Package barretenberg artifact + working-directory: barretenberg/cpp/build/bin + run: | + mkdir dist + cp ./bb ./dist/bb + 7z a -ttar -so -an ./dist/* | 7z a -si ./barretenberg-aarch64-apple-darwin.tar.gz + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: barretenberg-aarch64-apple-darwin + path: ./barretenberg/cpp/build/bin/barretenberg-aarch64-apple-darwin.tar.gz + retention-days: 3 + + release: + name: Publish + needs: [build-x86_64-linux-gnu, build-mac-intel, build-mac-m1,build-wasm-ts] + runs-on: ubuntu-latest + steps: + - name: Download files from Linux Runner + uses: actions/download-artifact@v2 + with: + name: release-linux + + - name: Download files for WASM + uses: actions/download-artifact@v2 + with: + name: release-wasm + + - name: Download files from x86_64 Mac Runner + uses: actions/download-artifact@v2 + with: + name: barretenberg-x86_64-apple-darwin + + - name: Download files from aarch64 Mac Runner + uses: actions/download-artifact@v2 + with: + name: barretenberg-aarch64-apple-darwin + + - name: Publish to GitHub + uses: softprops/action-gh-release@v1 + if: ${{ inputs.publish || github.event_name == 'schedule' }} + with: + tag_name: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch) + prerelease: true + files: | + barretenberg.wasm.tar.gz + acvm_backend.wasm.tar.gz + barretenberg-x86_64-linux-gnu.tar.gz + barretenberg-x86_64-apple-darwin.tar.gz + barretenberg-aarch64-apple-darwin.tar.gz