Skip to content

Commit 545db85

Browse files
committed
chore(release): 2.1.2
1 parent 02e2ec2 commit 545db85

6 files changed

Lines changed: 57 additions & 14 deletions

File tree

.github/workflows/publish-crates.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ jobs:
1919
- name: Install Rust
2020
uses: dtolnay/rust-toolchain@stable
2121

22+
- name: Verify release metadata
23+
run: |
24+
EXPECTED_VERSION="${GITHUB_REF#refs/tags/v}"
25+
MANIFEST_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
26+
27+
if [ "$MANIFEST_VERSION" != "$EXPECTED_VERSION" ]; then
28+
echo "::error::Cargo.toml version ${MANIFEST_VERSION} does not match tag ${EXPECTED_VERSION}"
29+
exit 1
30+
fi
31+
32+
cargo metadata --locked --format-version 1 >/dev/null
33+
2234
- name: Cache cargo
2335
uses: actions/cache@v4
2436
with:
@@ -32,19 +44,19 @@ jobs:
3244
run: cargo fmt --all -- --check
3345

3446
- name: Run clippy
35-
run: cargo clippy --all-targets --all-features -- -D warnings
47+
run: cargo clippy --locked --all-targets --all-features -- -D warnings
3648

3749
- name: Build
38-
run: cargo build --all-features --release
50+
run: cargo build --locked --all-features --release
3951

4052
- name: Run all tests
41-
run: cargo test --all-features
53+
run: cargo test --locked --all-features
4254

4355
- name: Run integration tests
44-
run: cargo test --all-features --test '*'
56+
run: cargo test --locked --all-features --test '*'
4557

4658
- name: Run doc tests
47-
run: cargo test --doc
59+
run: cargo test --locked --doc
4860

4961
- name: Publish solverforge-maps
50-
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
62+
run: cargo publish --locked --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/release.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ jobs:
2727
- name: Install Rust
2828
uses: dtolnay/rust-toolchain@stable
2929

30+
- name: Verify release metadata
31+
run: |
32+
if [ -n "${{ github.event.inputs.version }}" ]; then
33+
EXPECTED_VERSION="${{ github.event.inputs.version }}"
34+
else
35+
EXPECTED_VERSION="${GITHUB_REF#refs/tags/v}"
36+
fi
37+
38+
MANIFEST_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
39+
if [ "$MANIFEST_VERSION" != "$EXPECTED_VERSION" ]; then
40+
echo "::error::Cargo.toml version ${MANIFEST_VERSION} does not match release version ${EXPECTED_VERSION}"
41+
exit 1
42+
fi
43+
44+
cargo metadata --locked --format-version 1 >/dev/null
45+
3046
- name: Cache cargo
3147
uses: actions/cache@v4
3248
with:
@@ -40,16 +56,16 @@ jobs:
4056
run: cargo fmt --all -- --check
4157

4258
- name: Run clippy
43-
run: cargo clippy --all-targets --all-features -- -D warnings
59+
run: cargo clippy --locked --all-targets --all-features -- -D warnings
4460

4561
- name: Build
46-
run: cargo build --all-features --release
62+
run: cargo build --locked --all-features --release
4763

4864
- name: Run all tests
49-
run: cargo test --all-features
65+
run: cargo test --locked --all-features
5066

5167
- name: Run integration tests
52-
run: cargo test --all-features --test '*'
68+
run: cargo test --locked --all-features --test '*'
5369

5470
create-release:
5571
name: Create GitHub Release

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
44

5+
## [2.1.2](https://github.com/SolverForge/solverforge-maps/compare/v2.1.1...v2.1.2) (2026-04-12)
6+
7+
### Chores
8+
9+
* sync Cargo release metadata so crates.io publication succeeds
10+
* fail release automation when the tag, manifest, and lockfile drift apart
11+
512
## [2.1.1](///compare/v2.1.0...v2.1.1) (2026-04-03)
613

714

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "solverforge-maps"
3-
version = "2.1.1"
3+
version = "2.1.2"
44
edition = "2021"
55
description = "Generic map and routing utilities for VRP and similar problems"
66
license = "Apache-2.0"

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,19 @@ pre-release: banner
181181
@printf "$(CYAN)$(BOLD)╔══════════════════════════════════════════════════════════╗$(RESET)\n"
182182
@printf "$(CYAN)$(BOLD)║ Pre-Release Validation v$(VERSION)$(RESET)\n"
183183
@printf "$(CYAN)$(BOLD)╚══════════════════════════════════════════════════════════╝$(RESET)\n\n"
184+
@printf "$(PROGRESS) Verifying release metadata...\n"
185+
@cargo metadata --locked --format-version 1 >/dev/null && \
186+
printf "$(GREEN)$(CHECK) Cargo metadata is in sync$(RESET)\n" || \
187+
(printf "$(RED)$(CROSS) Cargo metadata is out of sync$(RESET)\n" && exit 1)
184188
@$(MAKE) fmt-check --no-print-directory
185189
@$(MAKE) clippy --no-print-directory
186190
@printf "$(PROGRESS) Running full test suite...\n"
187191
@cargo test --quiet && printf "$(GREEN)$(CHECK) All tests passed$(RESET)\n"
188192
@$(MAKE) test-live --no-print-directory
193+
@printf "$(PROGRESS) Running publish dry-run...\n"
194+
@cargo publish --dry-run --locked && \
195+
printf "$(GREEN)$(CHECK) Publish dry-run successful$(RESET)\n" || \
196+
(printf "$(RED)$(CROSS) Publish dry-run failed$(RESET)\n" && exit 1)
189197
@printf "\n$(GREEN)$(BOLD)$(CHECK) Ready for release v$(VERSION)$(RESET)\n\n"
190198

191199
# ============== Publishing ==============
@@ -196,7 +204,7 @@ publish-dry: test banner
196204
@printf "$(CYAN)$(BOLD)╚══════════════════════════════════════════════════════════╝$(RESET)\n\n"
197205
@printf "$(GREEN)$(CHECK) All tests passed$(RESET)\n"
198206
@printf "$(PROGRESS) Running publish dry-run...\n"
199-
@cargo publish --dry-run && \
207+
@cargo publish --dry-run --locked && \
200208
printf "$(GREEN)$(CHECK) Publish dry-run successful$(RESET)\n\n" || \
201209
(printf "$(RED)$(CROSS) Publish dry-run failed$(RESET)\n\n" && exit 1)
202210

@@ -208,7 +216,7 @@ publish: banner
208216
@printf "$(YELLOW)Press Ctrl+C to abort, or Enter to continue...$(RESET)\n"
209217
@read dummy
210218
@printf "\n$(PROGRESS) Publishing solverforge-maps...\n"
211-
@cargo publish && \
219+
@cargo publish --locked && \
212220
printf "$(GREEN)$(CHECK) Published successfully$(RESET)\n\n" || \
213221
(printf "$(RED)$(CROSS) Publish failed$(RESET)\n\n" && exit 1)
214222
@printf "\n$(GREEN)$(BOLD)╔══════════════════════════════════════════════════════════╗$(RESET)\n"

0 commit comments

Comments
 (0)