Skip to content

Commit fa825be

Browse files
mlavrinenkoclaude
andcommitted
fix(release): bump crate versions to 0.2.0 and add version safety checks
Use workspace.package.version for single-source version management. Add CI version-check job to fail fast if tag mismatches Cargo.toml. Add `just release VERSION` recipe for future releases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2728127 commit fa825be

6 files changed

Lines changed: 59 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,25 @@ permissions:
88
contents: write
99

1010
jobs:
11+
version-check:
12+
name: Verify tag matches Cargo.toml
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check version consistency
18+
run: |
19+
TAG="${GITHUB_REF_NAME#v}"
20+
CARGO="$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')"
21+
if [ "$TAG" != "$CARGO" ]; then
22+
echo "::error::Tag v${TAG} does not match workspace version ${CARGO} in Cargo.toml"
23+
exit 1
24+
fi
25+
echo "✓ Tag v${TAG} matches Cargo.toml version ${CARGO}"
26+
1127
check:
1228
name: Check
29+
needs: version-check
1330
runs-on: ubuntu-latest
1431
steps:
1532
- uses: actions/checkout@v4

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ members = [
55
]
66
resolver = "3"
77

8+
[workspace.package]
9+
version = "0.2.0"
10+
811
[workspace.lints.rust]
912
unsafe_code = "deny"
1013
unused_must_use = "deny"
@@ -97,7 +100,7 @@ uninlined_format_args = "deny"
97100

98101
[package]
99102
name = "mindtape"
100-
version = "0.1.0"
103+
version.workspace = true
101104
edition = "2024"
102105
rust-version = "1.89"
103106
description = "A file-based task tracker using Typst files as the source of truth"
@@ -116,8 +119,8 @@ name = "mindtape"
116119
path = "src/main.rs"
117120

118121
[dependencies]
119-
mindtape-eval = { path = "crates/mindtape-eval", version = "0.1.0" }
120-
mindtape-store = { path = "crates/mindtape-store", version = "0.1.0" }
122+
mindtape-eval = { path = "crates/mindtape-eval", version = "0.2.0" }
123+
mindtape-store = { path = "crates/mindtape-store", version = "0.2.0" }
121124
typst = "0.14"
122125
typst-syntax = "0.14"
123126
thiserror = "2"

Justfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,36 @@ check-file-size:
100100
echo "✓ All files within size limits"
101101
fi
102102

103+
# Release a new version: bumps workspace version, commits, tags, and pushes
104+
release VERSION:
105+
#!/usr/bin/env bash
106+
set -euo pipefail
107+
108+
# Validate semver format
109+
if ! echo "{{ VERSION }}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
110+
echo "❌ Invalid version format: {{ VERSION }} (expected: X.Y.Z)"
111+
exit 1
112+
fi
113+
114+
CURRENT=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')
115+
echo "Bumping $CURRENT → {{ VERSION }}"
116+
117+
# Update workspace version
118+
sed -i '0,/^version = ".*"/s//version = "{{ VERSION }}"/' Cargo.toml
119+
120+
# Update inter-crate dependency versions
121+
sed -i 's/\(mindtape-eval = { path = "[^"]*", version = \)"[^"]*"/\1"{{ VERSION }}"/' Cargo.toml crates/mindtape-store/Cargo.toml
122+
sed -i 's/\(mindtape-store = { path = "[^"]*", version = \)"[^"]*"/\1"{{ VERSION }}"/' Cargo.toml
123+
124+
# Verify it compiles
125+
cargo check --workspace -q
126+
127+
git add -A
128+
git commit -m "chore: bump version to {{ VERSION }}"
129+
git tag "v{{ VERSION }}"
130+
echo "✓ Created commit and tag v{{ VERSION }}"
131+
echo " Run 'git push && git push --tags' to trigger the release workflow"
132+
103133
# Validate that nix/install-example.nix parses correctly
104134
check-nix-example:
105135
nix-instantiate --parse nix/install-example.nix > /dev/null

crates/mindtape-eval/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mindtape-eval"
3-
version = "0.1.0"
3+
version.workspace = true
44
edition = "2024"
55
rust-version = "1.89"
66
description = "Typst evaluation and task extraction for MindTape"

crates/mindtape-store/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mindtape-store"
3-
version = "0.1.0"
3+
version.workspace = true
44
edition = "2024"
55
rust-version = "1.89"
66
description = "Store trait and SQLite backend for MindTape"
@@ -9,7 +9,7 @@ license = "MIT"
99
readme = "README.md"
1010

1111
[dependencies]
12-
mindtape-eval = { path = "../mindtape-eval", version = "0.1.0" }
12+
mindtape-eval = { path = "../mindtape-eval", version = "0.2.0" }
1313
typst = "0.14"
1414
rusqlite = { version = "0.38", features = ["bundled"] }
1515
sha2 = "0.10"

0 commit comments

Comments
 (0)