Skip to content

Commit 5d58efe

Browse files
committed
chore: bump version to 0.2.0 and add version update script
- Update version in Cargo.toml to 0.2.0 - Update README badge to reflect new version - Introduce a script for automated version updates (patch, minor, major)
1 parent f1c0791 commit 5d58efe

3 files changed

Lines changed: 68 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bayesian-ssh"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = "2021"
55
authors = ["Your Name <your.email@example.com>"]
66
description = "A fast and lightweight SSH session manager with Kerberos support"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Rust](https://img.shields.io/badge/Rust-1.70+-blue.svg)](https://rustup.rs/)
44
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
5-
[![Version](https://img.shields.io/badge/Version-0.1.0-orange.svg)](Cargo.toml)
5+
[![Version](https://img.shields.io/badge/Version-0.1.1-orange.svg)](Cargo.toml)
66
[![CI](https://github.com/abdoufermat5/bayesian-ssh/workflows/CI/badge.svg)](https://github.com/abdoufermat5/bayesian-ssh/actions/workflows/ci.yml)
77
[![Security](https://github.com/abdoufermat5/bayesian-ssh/workflows/Security/badge.svg)](https://github.com/abdoufermat5/bayesian-ssh/actions/workflows/security.yml)
88
[![Release](https://github.com/abdoufermat5/bayesian-ssh/workflows/Release/badge.svg)](https://github.com/abdoufermat5/bayesian-ssh/actions/workflows/release.yml)

scripts/update-version.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
# Update version script for Bayesian SSH
4+
# Usage: ./scripts/update-version.sh [patch|minor|major]
5+
6+
set -e
7+
8+
if [ $# -eq 0 ]; then
9+
echo "Usage: $0 [patch|minor|major]"
10+
echo "Example: $0 patch"
11+
exit 1
12+
fi
13+
14+
VERSION_TYPE=$1
15+
CURRENT_VERSION=$(grep '^version = ' Cargo.toml | cut -d'"' -f2)
16+
17+
echo "Current version: $CURRENT_VERSION"
18+
19+
# Parse current version
20+
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
21+
MAJOR=${VERSION_PARTS[0]}
22+
MINOR=${VERSION_PARTS[1]}
23+
PATCH=${VERSION_PARTS[2]}
24+
25+
case $VERSION_TYPE in
26+
"patch")
27+
NEW_PATCH=$((PATCH + 1))
28+
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
29+
;;
30+
"minor")
31+
NEW_MINOR=$((MINOR + 1))
32+
NEW_VERSION="$MAJOR.$NEW_MINOR.0"
33+
;;
34+
"major")
35+
NEW_MAJOR=$((MAJOR + 1))
36+
NEW_VERSION="$NEW_MAJOR.0.0"
37+
;;
38+
*)
39+
echo "Invalid version type: $VERSION_TYPE"
40+
echo "Use: patch, minor, or major"
41+
exit 1
42+
;;
43+
esac
44+
45+
echo "New version: $NEW_VERSION"
46+
47+
# Update Cargo.toml
48+
sed -i "s/version = \"$CURRENT_VERSION\"/version = \"$NEW_VERSION\"/" Cargo.toml
49+
50+
# Update README badge
51+
sed -i "s/Version-$CURRENT_VERSION/Version-$NEW_VERSION/g" README.md
52+
53+
# Update docs if they reference version
54+
find docs/ -name "*.md" -exec sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g" {} \;
55+
56+
echo "✅ Version updated to $NEW_VERSION in:"
57+
echo " - Cargo.toml"
58+
echo " - README.md"
59+
echo " - docs/ files"
60+
61+
echo ""
62+
echo "Next steps:"
63+
echo "1. Review changes: git diff"
64+
echo "2. Commit: git commit -am 'chore: bump version to $NEW_VERSION'"
65+
echo "3. Tag: git tag -a v$NEW_VERSION -m 'Release v$NEW_VERSION'"
66+
echo "4. Push: git push origin main && git push origin v$NEW_VERSION"

0 commit comments

Comments
 (0)