forked from purplegrapeZz/goroutine-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·39 lines (30 loc) · 1.17 KB
/
release.sh
File metadata and controls
executable file
·39 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# A robust script to automate the release process using semantic versioning.
# Usage: ./release.sh patch|minor|major
# Exit immediately if a command exits with a non-zero status.
set -e
# --- 1. Get the type of version bump ---
BUMP_TYPE=$1
# Check if a bump type is provided and is valid
if [[ "$BUMP_TYPE" != "patch" && "$BUMP_TYPE" != "minor" && "$BUMP_TYPE" != "major" ]]; then
echo "Error: Invalid or no bump type specified."
echo "Usage: ./release.sh <patch|minor|major>"
exit 1
fi
echo "🚀 Preparing a '$BUMP_TYPE' release..."
# --- 2. Run Linters & Tests ---
echo "🛡️ Running checks and tests..."
black --check .
isort --check .
pytest
echo "✅ All checks passed!"
# --- 3. Bump Version, Commit, and Tag ---
# The tool will now automatically figure out the current version,
# increment it, update the files, commit, and tag.
echo "🔖 Bumping version, committing, and tagging..."
bump-my-version bump "$BUMP_TYPE"
# --- 4. Push to trigger release workflow ---
echo "📤 Pushing commit and tag to GitHub..."
git push && git push --tags
echo "🎉 Successfully triggered release workflow!"
echo "Check the GitHub Actions tab for the publish progress."