Skip to content

Commit daa34e3

Browse files
echobtfactorydroid
andauthored
feat(version): centralize CLI version in VERSION_CLI file (#328)
- Create VERSION_CLI as single source of truth for CLI version - Update workspace Cargo.toml to use CLI version (0.0.4) - Update cortex-cli/Cargo.toml to use version.workspace = true - Add scripts/check-cli-version.sh to verify version consistency - Add version-check job to CI workflow - Add version verification step to release workflow for CLI releases This ensures: 1. All CLI crates share the same version from workspace 2. CI verifies VERSION_CLI matches Cargo.toml on every PR 3. Releases fail if tag version doesn't match VERSION_CLI Co-authored-by: Droid Agent <droid@factory.ai>
1 parent 36f9cde commit daa34e3

7 files changed

Lines changed: 166 additions & 38 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
jobs:
25+
# ==========================================================================
26+
# Version consistency check
27+
# ==========================================================================
28+
version-check:
29+
name: CLI Version Check
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Verify CLI version consistency
35+
run: ./scripts/check-cli-version.sh
36+
2537
# ==========================================================================
2638
# Setup job to prepare shared cache
2739
# ==========================================================================
@@ -255,12 +267,13 @@ jobs:
255267
ci-success:
256268
name: CI Success
257269
runs-on: ubuntu-latest
258-
needs: [fmt, clippy, test, build-check, gui-check, audit]
270+
needs: [version-check, fmt, clippy, test, build-check, gui-check, audit]
259271
if: always()
260272
steps:
261273
- name: Check all jobs
262274
run: |
263-
if [[ "${{ needs.fmt.result }}" == "failure" || \
275+
if [[ "${{ needs.version-check.result }}" == "failure" || \
276+
"${{ needs.fmt.result }}" == "failure" || \
264277
"${{ needs.clippy.result }}" == "failure" || \
265278
"${{ needs.test.result }}" == "failure" || \
266279
"${{ needs.build-check.result }}" == "failure" || \

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ jobs:
9797
echo "version=$VERSION" >> $GITHUB_OUTPUT
9898
echo "tag=$TAG" >> $GITHUB_OUTPUT
9999
100+
- name: Verify CLI version consistency
101+
if: steps.version.outputs.build_cli == 'true'
102+
run: |
103+
CLI_RELEASE_VERSION="${{ steps.version.outputs.version }}" ./scripts/check-cli-version.sh
104+
100105
# ==========================================================================
101106
# Build CLI Binaries
102107
# ==========================================================================

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ members = [
104104
]
105105

106106
[workspace.package]
107-
version = "0.1.0"
107+
# CLI version - kept in sync with VERSION_CLI file
108+
# Run `scripts/check-cli-version.sh` to verify consistency
109+
version = "0.0.4"
108110
edition = "2024"
109111
rust-version = "1.85"
110112
authors = ["Cortex Team <team@cortex.foundation>"]

VERSION_CLI

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.4

cortex-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cortex-cli"
3-
version = "0.0.4"
3+
version.workspace = true
44
edition.workspace = true
55
license.workspace = true
66
description = "Cortex CLI - Modern AI coding agent"

0 commit comments

Comments
 (0)