|
55 | 55 | - name: Install Rust |
56 | 56 | uses: dtolnay/rust-toolchain@master |
57 | 57 | with: |
58 | | - toolchain: nightly-2024-06-10 |
| 58 | + toolchain: nightly-2024-10-28 |
59 | 59 |
|
60 | 60 | - name: Install Circom |
61 | 61 | run: | |
@@ -87,18 +87,76 @@ jobs: |
87 | 87 | make debug # Show what will be processed |
88 | 88 | make build # Build the circuits |
89 | 89 |
|
| 90 | + - name: Configure Git for Private Repos |
| 91 | + run: | |
| 92 | + git config --global url."https://${{ secrets.PAT }}@github.com/".insteadOf "https://github.com/" |
| 93 | +
|
| 94 | + - name: Build and run parameter generator |
| 95 | + run: | |
| 96 | + rustup install nightly |
| 97 | +
|
| 98 | + # Build the parameter generator |
| 99 | + cargo build --release |
| 100 | + |
| 101 | + # Generate parameters using makefile target |
| 102 | + make params |
| 103 | + |
| 104 | + # Verify parameter files were created |
| 105 | + for target_dir in builds/target_*b; do |
| 106 | + size=$(basename "$target_dir" | sed 's/target_//') |
| 107 | + # Calculate ROM length the same way as in Makefile |
| 108 | + rom_length=$(echo "${size%b} / 16 + 16" | bc) |
| 109 | + |
| 110 | + # List of expected files |
| 111 | + files=( |
| 112 | + "aux_params_${size}_rom_length_${rom_length}.bin" |
| 113 | + "prover_key_${size}_rom_length_${rom_length}.bin" |
| 114 | + "verifier_key_${size}_rom_length_${rom_length}.bin" |
| 115 | + ) |
| 116 | + |
| 117 | + for file in "${files[@]}"; do |
| 118 | + if [ ! -f "$target_dir/artifacts/$file" ]; then |
| 119 | + echo "Error: File not found: $file in $target_dir/artifacts" |
| 120 | + exit 1 |
| 121 | + else |
| 122 | + echo "Successfully verified: $file" |
| 123 | + fi |
| 124 | + done |
| 125 | + |
| 126 | + echo "Successfully generated all parameter files for ${size}" |
| 127 | + done |
| 128 | +
|
90 | 129 | - name: Create release artifacts |
91 | 130 | run: | |
92 | | - # Get the list of target directories |
| 131 | + # First verify parameter files were created |
93 | 132 | for target_dir in builds/target_*b; do |
| 133 | + size=$(basename "$target_dir" | sed 's/target_//') |
| 134 | + # Calculate ROM length the same way as in Makefile |
| 135 | + rom_length=$(echo "${size%b} / 16 + 16" | bc) |
| 136 | + |
| 137 | + # List of expected files |
| 138 | + files=( |
| 139 | + "aux_params_${size}_rom_length_${rom_length}.bin" |
| 140 | + "prover_key_${size}_rom_length_${rom_length}.bin" |
| 141 | + "verifier_key_${size}_rom_length_${rom_length}.bin" |
| 142 | + ) |
| 143 | + |
| 144 | + for file in "${files[@]}"; do |
| 145 | + if [ ! -f "$target_dir/artifacts/$file" ]; then |
| 146 | + echo "Error: File not found: $file in $target_dir/artifacts" |
| 147 | + exit 1 |
| 148 | + else |
| 149 | + echo "Successfully verified: $file" |
| 150 | + fi |
| 151 | + done |
| 152 | + |
| 153 | + echo "Successfully generated all parameter files for ${size}" |
| 154 | + |
| 155 | + # Create zip archive for this target size |
94 | 156 | if [ -d "$target_dir/artifacts" ]; then |
95 | | - # Extract the target size from the directory name |
96 | | - target_size=$(basename "$target_dir") |
97 | | -
|
98 | | - echo "Creating archive for $target_size" |
99 | | - # Create zip file for this target size |
| 157 | + echo "Creating archive for $size" |
100 | 158 | ( cd "$target_dir/artifacts" && \ |
101 | | - zip -r "../../../circom-artifacts-${target_size}-v${{ env.VERSION }}.zip" . ) |
| 159 | + zip -r "../../../circom-artifacts-${size}-v${{ env.VERSION }}.zip" . ) |
102 | 160 | fi |
103 | 161 | done |
104 | 162 |
|
|
0 commit comments