Initialize #20
This file contains hidden or 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
name: Initialize | |
on: | |
workflow_dispatch: | |
jobs: | |
initialize: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
persist-credentials: false | |
- name: Install requirements | |
run: | | |
sudo apt install -y wget unzip | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install SnarkJS | |
run: | | |
npm i -g snarkjs | |
- name: Download Spend package | |
run: | | |
wget -q -O spend.zip https://circuitscan-artifacts.s3.us-west-2.amazonaws.com/build/spend-unlikely-white-gayal/pkg.zip | |
- name: Unzipping Spend package | |
run: | | |
mkdir spend && unzip spend.zip '*.zkey' -d spend && rm -rf spend.zip | |
- name: Download Proof-of-Burn package | |
run: | | |
wget -q -O proof_of_burn.zip https://circuitscan-artifacts.s3.us-west-2.amazonaws.com/build/proofofburn-alone-white-earwig/pkg.zip | |
- name: Unzipping Proof-of-Burn package | |
run: | | |
mkdir proof_of_burn && unzip proof_of_burn.zip '*.zkey' -d proof_of_burn && rm -rf proof_of_burn.zip | |
- name: Packaging parameters | |
run: | | |
mkdir 0000_circuitscan | |
mv spend/build/verify_circuit/groth16_pkey.zkey 0000_circuitscan/spend.zkey | |
mv proof_of_burn/build/verify_circuit/groth16_pkey.zkey 0000_circuitscan/proof_of_burn.zkey | |
snarkjs zkey export solidityverifier 0000_circuitscan/spend.zkey SpendVerifier.sol | |
snarkjs zkey export solidityverifier 0000_circuitscan/proof_of_burn.zkey ProofOfBurnVerifier.sol | |
cd 0000_circuitscan && tar czf ../0000_circuitscan.tar.gz && cd .. | |
rm -rf 0000_circuitscan/* | |
split -b1G 0000_circuitscan.tar.gz 0000_circuitscan.tar.gz. | |
rm -rf 0000_circuitscan.tar.gz | |
- name: Download GitHub CLI | |
run: | | |
wget -q https://github.com/cli/cli/releases/download/v2.76.1/gh_2.76.1_linux_amd64.deb | |
- name: Install GitHub CLI | |
run: | | |
sudo dpkg -i gh_2.76.1_linux_amd64.deb | |
- name: Login | |
run: | | |
echo "${{secrets.gh_token}}" | gh auth login --with-token | |
- name: Create release | |
run: | | |
gh release create 0000_circuitscan --title "CircuitScan's contribution" --notes "Initial contributions made by https://circuitscan.org" 0000_circuitscan.tar.gz.* *.sol | |
- name: Commit | |
run: | | |
echo "Initial contributions made by https://circuitscan.org" > 0000_circuitscan/README.md | |
git checkout -b contrib/0000_circuitscan | |
git add 0000_circuitscan/README.md | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
git commit -m "feat: Add CircuitScan's contribution" | |
git remote set-url origin https://x-access-token:${{secrets.gh_token}}@github.com/worm-privacy/trusted-setup.git | |
GITHUB_TOKEN=${{secrets.gh_token}} git push origin contrib/0000_circuitscan | |
gh repo set-default worm-privacy/trusted-setup | |
gh pr create --head worm-privacy:contrib/0000_circuitscan --base main --title "CircuitScan's contribution" --body "CircuitScan's contribution" --repo worm-privacy/trusted-setup |