diff --git a/circuits/cpp/barretenberg/.github/workflows/release-please.yml b/circuits/cpp/barretenberg/.github/workflows/release-please.yml index 40cf41eeb46..8630cabe7e7 100644 --- a/circuits/cpp/barretenberg/.github/workflows/release-please.yml +++ b/circuits/cpp/barretenberg/.github/workflows/release-please.yml @@ -11,8 +11,139 @@ name: release-please jobs: release-please: + name: Create Release + outputs: + tag-name: ${{ steps.release.outputs.tag_name }} runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v3 + - name: Run Release Please + id: release + uses: google-github-actions/release-please-action@v3 with: command: manifest + + build-linux: + name: Build on Linux + runs-on: ubuntu-latest + needs: [release-please] + if: ${{ needs.release-please.outputs.tag-name }} + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - 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 clang ninja-build yarn + - name: Install yarn + 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: Compile Barretenberg + run: | + cd cpp + + cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert + cmake --build --preset default --target bb + + ./scripts/install-wasi-sdk.sh + + cmake --preset wasm + cmake --build --preset wasm + + - name: Copy Barretenberg.wasm to Root directory + run: cp cpp/build-wasm/bin/barretenberg.wasm ./ + + - name: Compile Typescript + run: | + cd ts + yarn install && yarn && yarn build + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + - name: Deploy Typescript to NPM + run: | + cd ts + yarn deploy + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: Tar and GZip bb Binary (Ubuntu) + run: tar -cvzf bb-ubuntu.tar.gz cpp/build/bin/bb + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: release-linux-wasm + path: | + barretenberg.wasm + bb-ubuntu.tar.gz + + build-mac: + name: Build on Mac + runs-on: macos-13 + needs: [release-please] + if: ${{ needs.release-please.outputs.tag-name }} + steps: + - name: Checkout + uses: actions/checkout@v3 +# We need clang 14.0.3 or higher, as lower versions do not seem +# to be spec conformant. In particular std::span does not seem +# to follow the specifications. + - name: Select Xcode version + run: | + sudo xcode-select -switch /Applications/Xcode_14.3.1.app + + - name: Create Mac Build Environment + run: | + brew install cmake ninja + + - name: Compile Barretenberg + run: | + cd cpp + cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert + cmake --build --preset default --target bb + + - name: Tar bb binary (Mac) + run: tar -cvzf bb-mac.tar.gz cpp/build/bin/bb + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: release-mac + path: bb-mac.tar.gz + + release: + name: Publish + needs: [build-linux, build-mac, release-please] + runs-on: ubuntu-latest + steps: + - name: Download files from Linux Runner + uses: actions/download-artifact@v2 + with: + name: release-linux-wasm + + - name: Download files from Mac Runner + uses: actions/download-artifact@v2 + with: + name: release-mac + + - name: Publish to GitHub + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ needs.release-please.outputs.tag-name }} + prerelease: true + files: | + barretenberg.wasm + bb-ubuntu.tar.gz + bb-mac.tar.gz diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/file_io.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/file_io.hpp index ee5814fafaf..c739e166a7c 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/file_io.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/file_io.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include #include -#include inline std::vector read_file(const std::string& filename) { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp index 6fbabc6409e..b85749209d3 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp @@ -2,11 +2,11 @@ #include "exec_pipe.hpp" #include "file_io.hpp" #include "vinfo.hpp" +#include +#include #include #include #include -#include -#include inline std::vector download_g1_data(size_t num_points) { diff --git a/circuits/cpp/barretenberg/release-please-config.json b/circuits/cpp/barretenberg/release-please-config.json index 031142d1e2a..efa9146e274 100644 --- a/circuits/cpp/barretenberg/release-please-config.json +++ b/circuits/cpp/barretenberg/release-please-config.json @@ -4,7 +4,6 @@ "bump-patch-for-minor-pre-major": true, "prerelease": true, "group-pull-request-title-pattern": "chore(barretenberg): Release ${version}", - "release-as": "0.3.0", "packages": { ".": { "release-type": "simple",