File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ make rust-export # Generate Rust mapping JSON exports
2020make export-schemas # Regenerate problem schemas JSON
2121make qubo-testdata # Regenerate QUBO ground truth JSON
2222make clean # Clean build artifacts
23+ make release V=x.y.z # Tag and push a new release (CI publishes to crates.io)
2324```
2425
2526## Verify Changes
Original file line number Diff line number Diff line change @@ -32,11 +32,17 @@ jobs:
3232 runs-on : ubuntu-latest
3333 steps :
3434 - uses : actions/checkout@v4
35-
35+
3636 - name : Install Rust stable
3737 uses : dtolnay/rust-toolchain@stable
38-
38+
3939 - uses : Swatinem/rust-cache@v2
40-
41- - name : Publish to crates.io
40+
41+ - name : Publish macros crate
42+ run : cargo publish --manifest-path problemreductions-macros/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
43+
44+ - name : Wait for macros crate to be indexed
45+ run : sleep 30
46+
47+ - name : Publish main crate
4248 run : cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
Original file line number Diff line number Diff line change 11# Makefile for problemreductions
22
3- .PHONY : help build test fmt clippy doc mdbook paper examples clean coverage rust-export compare qubo-testdata export-schemas
3+ .PHONY : help build test fmt clippy doc mdbook paper examples clean coverage rust-export compare qubo-testdata export-schemas release
44
55# Default target
66help :
2121 @echo " examples - Generate example JSON for paper"
2222 @echo " export-schemas - Export problem schemas to JSON"
2323 @echo " qubo-testdata - Regenerate QUBO test data (requires uv)"
24+ @echo " release V=x.y.z - Tag and push a new release (triggers CI publish)"
2425
2526# Build the project
2627build :
@@ -101,6 +102,22 @@ check: fmt-check clippy test
101102qubo-testdata :
102103 cd scripts && uv run python generate_qubo_tests.py
103104
105+ # Release a new version: make release V=0.2.0
106+ release :
107+ ifndef V
108+ $(error Usage: make release V=x.y.z)
109+ endif
110+ @echo "Releasing v$(V)..."
111+ sed -i 's/^version = ".*"/version = "$(V)"/' Cargo.toml
112+ sed -i 's/^version = ".*"/version = "$(V)"/' problemreductions-macros/Cargo.toml
113+ sed -i 's/problemreductions-macros = { version = "[^"]*"/problemreductions-macros = { version = "$(V)"/' Cargo.toml
114+ cargo check
115+ git add Cargo.toml problemreductions-macros/Cargo.toml
116+ git commit -m "release: v$(V)"
117+ git tag -a "v$(V)" -m "Release v$(V)"
118+ git push origin main --tags
119+ @echo "v$(V) pushed — CI will publish to crates.io"
120+
104121# Generate Rust mapping JSON exports for all graphs and modes
105122GRAPHS := diamond bull house petersen
106123MODES := unweighted weighted triangular
You can’t perform that action at this time.
0 commit comments