Skip to content

Commit 3b22013

Browse files
GiggleLiuclaude
andcommitted
chore: add make release target and fix CI publish
- Fix release workflow to publish macros crate before main crate - Add `make release V=x.y.z` to bump versions, tag, and push - CI handles crates.io publishing automatically on tag push Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6f31c79 commit 3b22013

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ make rust-export # Generate Rust mapping JSON exports
2020
make export-schemas # Regenerate problem schemas JSON
2121
make qubo-testdata # Regenerate QUBO ground truth JSON
2222
make 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

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff 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 }}

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
66
help:
@@ -21,6 +21,7 @@ help:
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
2627
build:
@@ -101,6 +102,22 @@ check: fmt-check clippy test
101102
qubo-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
105122
GRAPHS := diamond bull house petersen
106123
MODES := unweighted weighted triangular

0 commit comments

Comments
 (0)