From 51fa7d748f551864bdc3989b5429d7826865c43d Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 3 Sep 2024 08:44:17 -0400 Subject: [PATCH 1/3] Add release action Signed-off-by: Jim Zhang --- .github/workflows/release.yaml | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e141bcf --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,58 @@ +name: release + +# triggered on pushing a tag +on: + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install circom + uses: supplypike/setup-bin@v4 + with: + uri: https://github.com/iden3/circom/releases/download/v2.1.9/circom-linux-amd64 + name: circom + version: 2.1.9 + + - name: Setup node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: install snarkjs + run: | + npm install -g snarkjs + + - name: Checkout circuits + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup temp dir for the artifacts + run: | + mkdir -p ${{ runner.temp }}/zeto-artifacts + + - name: Build circuits + env: + CIRCUITS_ROOT: ${{ runner.temp }}/zeto-artifacts + PROVING_KEYS_ROOT: ${{ runner.temp }}/zeto-artifacts + PTAU_DOWNLOAD_PATH: ${{ runner.temp }}/zeto-artifacts + working-directory: zkp/circuits + run: | + npm install + npm run gen + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha') }} + files: | + ${{ runner.temp }}/zeto-artifacts/**/*.wasm + ${{ runner.temp }}/zeto-artifacts/**/*.zkey From be41d3d45bb346a50d8e8b359eecebfa488a1a7b Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 3 Sep 2024 09:24:44 -0400 Subject: [PATCH 2/3] Use different action extensions Signed-off-by: Jim Zhang --- .github/workflows/release.yaml | 42 ++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e141bcf..e62e0a1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,6 +6,9 @@ on: tags: - 'v*.*.*' +env: + ZETO_VER: ${{ github.ref_name }} + jobs: build: runs-on: ubuntu-latest @@ -48,11 +51,36 @@ jobs: npm install npm run gen - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + - name: Create artifacts archives + working-directory: ${{ runner.temp }}/zeto-artifacts + run: | + tar -czvf zeto-wasm.tar.gz **/*.wasm + tar -czvf zeto-test-proving-keys.tar.gz *.zkey *-vkey.json + + - name: Publish Release Artifact + uses: actions/upload-artifact@v4 with: - prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha') }} - files: | - ${{ runner.temp }}/zeto-artifacts/**/*.wasm - ${{ runner.temp }}/zeto-artifacts/**/*.zkey + name: zeto-wasm-and-proving-keys + path: | + ${{ runner.temp }}/zeto-artifacts/zeto-wasm.tar.gz + ${{ runner.temp }}/zeto-artifacts/**/zeto-test-proving-keys.tar.gz + + create-release: + name: Create GitHub Release + needs: + - build + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Download Artifacts + id: download + uses: actions/download-artifact@v4 + - name: Release Zeto Version + uses: ncipollo/release-action@v1 + with: + allowUpdates: 'true' + artifacts: zeto-wasm.tar.gz,zeto-test-proving-keys.tar.gz + tag: ${{ env.ZETO_VER }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 43e260877cabc7c31f2da199aebce6c8e458e3ae Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 3 Sep 2024 11:22:57 -0400 Subject: [PATCH 3/3] Eliminate duplicate checkout step Signed-off-by: Jim Zhang --- .github/workflows/release.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e62e0a1..8b84425 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -71,8 +71,6 @@ jobs: - build runs-on: ubuntu-latest steps: - - name: Checkout Code - uses: actions/checkout@v4 - name: Download Artifacts id: download uses: actions/download-artifact@v4