Skip to content

Commit 6102d49

Browse files
committed
patch
1 parent 7e03e2a commit 6102d49

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

release.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
#!/bin/bash
22

3-
# A robust script to automate the release process using bump-my-version.
4-
# It ensures checks pass before releasing.
3+
# A robust script to automate the release process using semantic versioning.
4+
# Usage: ./release.sh patch|minor|major
55

66
# Exit immediately if a command exits with a non-zero status.
77
set -e
88

9-
# --- 1. Get the new version number ---
10-
VERSION=$1
9+
# --- 1. Get the type of version bump ---
10+
BUMP_TYPE=$1
1111

12-
if [ -z "$VERSION" ]; then
13-
echo "Error: No version specified."
14-
echo "Usage: ./release.sh <new_version>"
15-
echo "Example: ./release.sh 0.2.0"
12+
if [[ "$BUMP_TYPE" != "patch" && "$BUMP_TYPE" != "minor" && "$BUMP_TYPE" != "major" ]]; then
13+
echo "Error: Invalid or no bump type specified."
14+
echo "Usage: ./release.sh <patch|minor|major>"
1615
exit 1
1716
fi
1817

19-
echo "🚀 Preparing new release: v$VERSION"
18+
echo "🚀 Preparing a '$BUMP_TYPE' release..."
2019

2120
# --- 2. Run Linters & Tests ---
2221
echo "🛡️ Running checks and tests..."
@@ -26,12 +25,14 @@ pytest
2625
echo "✅ All checks passed!"
2726

2827
# --- 3. Bump Version, Commit, and Tag ---
28+
# The tool will now automatically figure out the current version,
29+
# increment it, update the files, commit, and tag.
2930
echo "🔖 Bumping version, committing, and tagging..."
30-
bump-my-version bump --new-version "$VERSION"
31+
bump-my-version bump "$BUMP_TYPE"
3132

3233
# --- 4. Push to trigger release workflow ---
3334
echo "📤 Pushing commit and tag to GitHub..."
3435
git push && git push --tags
3536

36-
echo "🎉 Successfully published version v$VERSION!"
37-
echo "Check the GitHub Actions tab for the publish workflow."
37+
echo "🎉 Successfully triggered release workflow!"
38+
echo "Check the GitHub Actions tab for the publish progress."

0 commit comments

Comments
 (0)