Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add workflow to output to dev-bb.js #1299

Merged
merged 8 commits into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 82 additions & 64 deletions circuits/cpp/barretenberg/.github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,68 +28,86 @@ jobs:
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

- name: Install WASI-SDK
run: |
- name: Checkout Code
uses: actions/checkout@v3

- 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

- name: Install WASI-SDK
run: |
cd cpp

./scripts/install-wasi-sdk.sh

- name: Compile Typescript
run: |
cd ts
yarn install && yarn && yarn build

- name: Tar and GZip barretenberg.wasm
run: tar -cvzf barretenberg.wasm.tar.gz cpp/build-wasm/bin/barretenberg.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
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: Compile Typescript
run: |
cd ts
yarn install && yarn && yarn build

- name: Checkout destination repository
uses: actions/checkout@v3
with:
repository: AztecProtocol/dev-bb.js
path: ./dev-bb.js
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}

- name: Push to destination repository
run: |
cd ./dev-bb.js
cp -R ../ts/dest/* .
git config --global user.name AztecBot
git config --global user.email tech@aztecprotocol.com
git checkout -b dev || git checkout dev
git add .
git commit -m "Tracking changes"
git push origin dev

- name: Tar and GZip barretenberg.wasm
run: tar -cvzf barretenberg.wasm.tar.gz cpp/build-wasm/bin/barretenberg.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
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.tar.gz
bb-ubuntu.tar.gz

build-mac:
name: Build on Mac
runs-on: macos-13
Expand All @@ -98,23 +116,23 @@ jobs:
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.
# 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
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

Expand All @@ -133,12 +151,12 @@ jobs:
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:
Expand Down