forked from kobigurk/phase2-bn254
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: 'true' | ||
|
||
- name: Install build-essential, curl, git, wget, and Docker | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential curl git wget | ||
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
sudo apt-get update | ||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | ||
echo "Installed build-essential, curl, git, wget, and Docker" | ||
- name: Setup Rust and Cargo | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.51.0 | ||
override: true | ||
components: rustc, cargo | ||
|
||
- name: Build app | ||
run: sh build.sh | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: ./dist/ | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download build artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: ./dist | ||
|
||
- name: Prepare release | ||
run: zip -r dist.zip dist | ||
|
||
- name: Get the current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M')" | ||
|
||
- name: Create new release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.date.outputs.date }} | ||
release_name: "Release: ${{ steps.date.outputs.date }}" | ||
draft: false | ||
prerelease: false | ||
body: "Hackachain phase 2 bn256 release at ${{ steps.date.outputs.date }}" | ||
|
||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_name: dist.zip | ||
asset_path: ./dist.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Use ubuntu 20.04 for building, otherwise the binary will not work on gramine image | ||
|
||
cd ./powersoftau | ||
cargo build --release --bin new_constrained | ||
cargo build --release --bin compute_constrained | ||
cargo build --release --bin verify_transform_constrained | ||
cargo build --release --bin beacon_constrained | ||
cargo build --release --bin prepare_phase2 | ||
|
||
mkdir -p ../dist/bin | ||
cp target/release/new_constrained ../dist/bin | ||
cp target/release/compute_constrained ../dist/bin | ||
cp target/release/verify_transform_constrained ../dist/bin | ||
cp target/release/beacon_constrained ../dist/bin | ||
cp target/release/prepare_phase2 ../dist/bin | ||
|
||
cd ../phase2 | ||
|
||
cargo build --release --bin new | ||
cargo build --release --bin contribute | ||
cargo build --release --bin verify_contribution | ||
|
||
cp target/release/new ../dist/bin | ||
cp target/release/contribute ../dist/bin | ||
cp target/release/verify_contribution ../dist/bin |