Skip to content

Commit

Permalink
feat: Google Cloud Storage bucket uploads (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattes authored Jan 17, 2025
1 parent f00ea35 commit 12eb3a0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -134,4 +136,4 @@ jobs:
with:
name: circom-artifacts-v${{ env.VERSION }}
path: circom-artifacts-*-v${{ env.VERSION }}.zip
retention-days: 5
retention-days: 14
27 changes: 26 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ permissions:
contents: write
pull-requests: write
issues: write
id-token: write

jobs:
release:
name: Release
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:
Expand Down Expand Up @@ -71,4 +77,23 @@ jobs:
tag_name: v${{ env.VERSION }}
body_path: release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 12eb3a0

Please sign in to comment.