Merge pull request #6 from codex-storage/feature/include-r1cs-and-wasm-files

Upload ZIP file with wasm, r1cs, and zkey file
This commit is contained in:
Ben Bierens 2024-03-04 08:17:42 +01:00 committed by GitHub
commit 066bd73a0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,6 +48,9 @@ env:
ceremony_source: https://storage.googleapis.com/zkevm/ptau/powersOfTau28_hez_final_21.ptau
s3_bucket_path: proving-key
circuit_file: workflow/build/proof_main.zkey
constraints_file: workflow/build/proof_main.r1cs
wasm_file: workflow/build/proof_main_js/proof_main.wasm
zip_file: workflow/build/proof_circuit.zip
storage_url: https://circuit.codex.storage
jobs:
@ -132,12 +135,14 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
run: |
# Zip
zip -qj ${{ env.zip_file }} ${{ env.circuit_file }} ${{ env.constraints_file }} ${{ env.wasm_file }}
# Variables
hash=($(shasum -a 256 ${{ env.circuit_file }}))
hash=($(shasum -a 256 ${{ env.zip_file }}))
[[ -z "${{ env.s3_bucket_path}}" ]] && storage_file="${hash}" || storage_file="${{ env.s3_bucket_path}}/${hash}"
echo "storage_file=${storage_file}" >>$GITHUB_ENV
# Upload
aws s3 cp ${{ env.circuit_file }} s3://${{ env.s3_bucket }}/${storage_file} --endpoint-url ${{ env.s3_endpoint }}
aws s3 cp ${{ env.zip_file }} s3://${{ env.s3_bucket }}/${storage_file} --endpoint-url ${{ env.s3_endpoint }}
# Add hash to the assets
echo "\"${hash}\"" > workflow/build/zkey_hash.json