Skip to content

Commit

Permalink
chore(ci): Upload build artifacts on releases (AztecProtocol/barreten…
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray authored Jul 11, 2023
1 parent 3c04e4a commit 6738d5c
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 5 deletions.
133 changes: 132 additions & 1 deletion circuits/cpp/barretenberg/.github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <barretenberg/common/log.hpp>
#include <fstream>
#include <vector>
#include <barretenberg/common/log.hpp>

inline std::vector<uint8_t> read_file(const std::string& filename)
{
Expand Down
4 changes: 2 additions & 2 deletions circuits/cpp/barretenberg/cpp/src/barretenberg/bb/get_crs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#include "exec_pipe.hpp"
#include "file_io.hpp"
#include "vinfo.hpp"
#include <barretenberg/ecc/curves/bn254/g1.hpp>
#include <barretenberg/srs/io.hpp>
#include <filesystem>
#include <fstream>
#include <ios>
#include <barretenberg/ecc/curves/bn254/g1.hpp>
#include <barretenberg/srs/io.hpp>

inline std::vector<uint8_t> download_g1_data(size_t num_points)
{
Expand Down
1 change: 0 additions & 1 deletion circuits/cpp/barretenberg/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6738d5c

Please sign in to comment.