From 3eb952dde10d6de45ad9b05b0891ad73fa62b22b Mon Sep 17 00:00:00 2001 From: jonybur Date: Tue, 25 Jul 2023 13:25:04 +0000 Subject: [PATCH 1/4] Add bbjs workflow --- .github/workflows/bbjs.yml | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/bbjs.yml diff --git a/.github/workflows/bbjs.yml b/.github/workflows/bbjs.yml new file mode 100644 index 0000000000..dab5a492f1 --- /dev/null +++ b/.github/workflows/bbjs.yml @@ -0,0 +1,61 @@ +name: Release bb.js + +on: + push: + branches: + - jb/bbjs-workflow + +jobs: + build-and-deploy: + name: Build on Linux + runs-on: ubuntu-20.04 + 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: | + cd cpp + ./scripts/install-wasi-sdk.sh + + - name: Compile Typescript + run: | + cd ts + yarn install && yarn && yarn build + + - name: Checkout destination repository + uses: actions/checkout@v3 + with: + repository: AztecProtocol/bb.js + path: ./bb.js + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Push to destination repository + run: | + cd ./bb.js + cp -R ../ts/dest/* . + git add . + git commit -m "Tracking changes" + git push From bc250d150eeebe08e7d85d0eed6ac68585eea5e6 Mon Sep 17 00:00:00 2001 From: jonybur Date: Fri, 28 Jul 2023 14:45:12 +0000 Subject: [PATCH 2/4] Add user credentials for workflow --- .github/workflows/bbjs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bbjs.yml b/.github/workflows/bbjs.yml index dab5a492f1..29addded90 100644 --- a/.github/workflows/bbjs.yml +++ b/.github/workflows/bbjs.yml @@ -56,6 +56,8 @@ jobs: run: | cd ./bb.js cp -R ../ts/dest/* . + git config user.email "jony@aztecprotocol.com" + git config user.name "GitHub Workflow" git add . git commit -m "Tracking changes" git push From fc5bb10ce6c1a0546a813ff300f0b73213278d46 Mon Sep 17 00:00:00 2001 From: jonybur Date: Tue, 1 Aug 2023 14:48:21 +0000 Subject: [PATCH 3/4] Update workflow --- .github/workflows/bbjs.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bbjs.yml b/.github/workflows/bbjs.yml index 29addded90..edfd82d167 100644 --- a/.github/workflows/bbjs.yml +++ b/.github/workflows/bbjs.yml @@ -1,3 +1,4 @@ +# Note to reviewer: this yml will be merged with the release-please yml, this is just for developing name: Release bb.js on: @@ -11,7 +12,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install bleeding edge cmake run: | @@ -31,33 +32,32 @@ jobs: - name: Compile Barretenberg run: | - cd cpp cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert cmake --build --preset default --target bb + working-directory: ./circuits/cpp/barretenberg/cpp - name: Install WASI-SDK - run: | - cd cpp - ./scripts/install-wasi-sdk.sh + run: ./scripts/install-wasi-sdk.sh + working-directory: ./circuits/cpp/barretenberg/cpp - name: Compile Typescript - run: | - cd ts - yarn install && yarn && yarn build + run: yarn install && yarn && yarn build + working-directory: ./circuits/cpp/barretenberg/ts - name: Checkout destination repository uses: actions/checkout@v3 with: - repository: AztecProtocol/bb.js - path: ./bb.js - token: ${{ secrets.GITHUB_TOKEN }} + repository: AztecProtocol/dev-bb.js + path: ./dev-bb.js + token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} - name: Push to destination repository run: | - cd ./bb.js - cp -R ../ts/dest/* . - git config user.email "jony@aztecprotocol.com" - git config user.name "GitHub Workflow" + cd ./dev-bb.js + cp -R ../circuits/cpp/barretenberg/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 + git push origin dev From bd3989ce5595c9b32e28941828d2ffda02b2e83b Mon Sep 17 00:00:00 2001 From: jonybur Date: Tue, 1 Aug 2023 14:50:09 +0000 Subject: [PATCH 4/4] Fix paths --- .github/workflows/bbjs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bbjs.yml b/.github/workflows/bbjs.yml index edfd82d167..dfa576cefc 100644 --- a/.github/workflows/bbjs.yml +++ b/.github/workflows/bbjs.yml @@ -34,15 +34,15 @@ jobs: run: | cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert cmake --build --preset default --target bb - working-directory: ./circuits/cpp/barretenberg/cpp + working-directory: ./cpp - name: Install WASI-SDK run: ./scripts/install-wasi-sdk.sh - working-directory: ./circuits/cpp/barretenberg/cpp + working-directory: ./cpp - name: Compile Typescript run: yarn install && yarn && yarn build - working-directory: ./circuits/cpp/barretenberg/ts + working-directory: ./ts - name: Checkout destination repository uses: actions/checkout@v3 @@ -54,7 +54,7 @@ jobs: - name: Push to destination repository run: | cd ./dev-bb.js - cp -R ../circuits/cpp/barretenberg/ts/dest/* . + 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