From 12eb3a09b5dc4a08f25e27f8f50c8f40ef522d2e Mon Sep 17 00:00:00 2001 From: Matt <1240531+mattes@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:03:53 -0800 Subject: [PATCH] feat: Google Cloud Storage bucket uploads (#94) --- .github/workflows/artifacts.yaml | 4 +++- .github/workflows/release.yaml | 27 ++++++++++++++++++++++++++- package.json | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/artifacts.yaml b/.github/workflows/artifacts.yaml index dd5660d..41e8cf7 100644 --- a/.github/workflows/artifacts.yaml +++ b/.github/workflows/artifacts.yaml @@ -120,6 +120,8 @@ jobs: if [ -d "$target_dir/artifacts" ]; then echo "Creating archive for $size" ( cd "$target_dir/artifacts" && \ + find . -type f -name "*.wasm" -exec bash -c 'mv "$1" "$(dirname "$1")/../"' _ {} \; &&\ + rm -rf *_js &&\ zip -r "../../../circom-artifacts-${size}-v${{ env.VERSION }}.zip" . ) fi done @@ -134,4 +136,4 @@ jobs: with: name: circom-artifacts-v${{ env.VERSION }} path: circom-artifacts-*-v${{ env.VERSION }}.zip - retention-days: 5 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ffcc874..96a618d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,6 +9,7 @@ permissions: contents: write pull-requests: write issues: write + id-token: write jobs: release: @@ -16,6 +17,11 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: + - uses: "google-github-actions/auth@v2" + with: + project_id: "web-prover-circuits-fa4cf3" + workload_identity_provider: "projects/530011589985/locations/global/workloadIdentityPools/github/providers/web-prover-circuits" + - name: Checkout uses: actions/checkout@v4 with: @@ -71,4 +77,23 @@ jobs: tag_name: v${{ env.VERSION }} body_path: release_notes.md env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Prepare artifacts for Google Cloud Storage Bucket + run: | + # Unzip, then gzip each individual file (but remove .gz suffix), delete zip files + for zip_file in artifacts/circom-artifacts-*-v${{ env.VERSION }}.zip; do + unzip "$zip_file" -d "${zip_file%.zip}" + (cd "${zip_file%.zip}" && gzip -7 * && for file in *.gz; do mv "$file" "${file%.gz}"; done) + done + rm *.zip + + - uses: "google-github-actions/upload-cloud-storage@v2" + with: + path: "artifacts" + destination: "web-prover-circuits.pluto.xyz/${{ github.sha }}" + parent: false + gzip: false # already gzipped + headers: |- + content-type: 'application/octet-stream' + content-encoding: 'gzip' diff --git a/package.json b/package.json index f6eaa8d..a66f5a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "web-prover-circuits", "description": "ZK Circuits for WebProofs", - "version": "0.7.2", + "version": "0.7.3", "license": "Apache-2.0", "repository": { "type": "git",