Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,36 @@ compare_versions() {
}

# Calculate new version
# Check if current version is a prerelease (contains '-')
IS_PRERELEASE=false
if [[ "$CURRENT_VERSION" == *-* ]]; then
IS_PRERELEASE=true
fi

case $BUMP_TYPE in
patch)
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
# If prerelease, just remove prerelease tag to get stable version
if [ "$IS_PRERELEASE" = true ]; then
NEW_VERSION="$BASE_VERSION"
else
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
fi
;;
minor)
NEW_VERSION="$MAJOR.$((MINOR + 1)).0"
# If prerelease, just remove prerelease tag to get stable version
if [ "$IS_PRERELEASE" = true ]; then
NEW_VERSION="$BASE_VERSION"
else
NEW_VERSION="$MAJOR.$((MINOR + 1)).0"
fi
;;
major)
NEW_VERSION="$((MAJOR + 1)).0.0"
# If prerelease, just remove prerelease tag to get stable version
if [ "$IS_PRERELEASE" = true ]; then
NEW_VERSION="$BASE_VERSION"
else
NEW_VERSION="$((MAJOR + 1)).0.0"
fi
;;
*)
# Assume it's an exact version - validate format
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-cli-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ WORKSPACE_VERSION=$(grep -A20 '^\[workspace\.package\]' "$CARGO_TOML" | grep '^v
echo "Workspace Cargo.toml: $WORKSPACE_VERSION"

# Also check cortex-cli/Cargo.toml uses workspace version
CORTEX_CLI_CARGO="$REPO_ROOT/cortex-cli/Cargo.toml"
CORTEX_CLI_CARGO="$REPO_ROOT/src/cortex-cli/Cargo.toml"
if [ -f "$CORTEX_CLI_CARGO" ]; then
CLI_VERSION_LINE=$(grep '^version' "$CORTEX_CLI_CARGO" | head -1)
if [[ "$CLI_VERSION_LINE" == *"workspace = true"* ]]; then
Expand Down