Skip to content

Commit

Permalink
feat: update Makefile and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Nov 19, 2024
1 parent a4759fe commit 56a7942
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,27 @@ jobs:
make debug # Show what will be processed
make build # Build the circuits
- name: Build and run parameter generator
run: |
# Build the parameter generator
cd parameter-generator
cargo build --release
cd ..
# Generate parameters using makefile target
make params
# Verify parameter files were created
for target_dir in builds/target_*b; do
size=$(basename "$target_dir" | sed 's/target_//')
if [ ! -f "$target_dir/artifacts/aux_params_${size}.bin" ]; then
echo "Error: Parameter file not found for ${size}"
exit 1
else
echo "Successfully generated parameters for ${size}"
fi
done
- name: Create release artifacts
run: |
# Get the list of target directories
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ TARGET_DIRS := $(wildcard builds/target_*b)
# Find all .circom files in those directories
CIRCOM_FILES := $(wildcard $(addsuffix /*_*b.circom,$(TARGET_DIRS)))

# Extract target sizes (e.g., "512b", "1024b") from directory names
TARGET_SIZES := $(patsubst builds/target_%,%,$(TARGET_DIRS))

# Create artifacts directories
$(shell mkdir -p $(addsuffix /artifacts,$(TARGET_DIRS)))

Expand All @@ -22,6 +25,14 @@ build:
echo "====================xxxxxxxxxx===================="; \
done

# Parameters target
.PHONY: params
params:
@for size in $(TARGET_SIZES); do \
echo "Generating parameters for $${size}..."; \
cargo run --release --manifest-path parameter-generator/Cargo.toml -- builds/target_$${size}/artifacts $${size}; \
done

# Clean target
clean:
rm -rf $(addsuffix /artifacts,$(TARGET_DIRS))
Expand All @@ -33,5 +44,7 @@ debug:
@echo $(TARGET_DIRS)
@echo "\nFound circom files:"
@echo $(CIRCOM_FILES)
@echo "\nFound target sizes:"
@echo $(TARGET_SIZES)
@echo "\nArtifacts will be generated in:"
@echo $(addsuffix /artifacts,$(TARGET_DIRS))

0 comments on commit 56a7942

Please sign in to comment.