Skip to content

Commit 38bb3fa

Browse files
add release script
1 parent 13f06df commit 38bb3fa

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ env/
2020

2121
*.zip
2222
sandbox.*
23-
release.sh

release.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Usage: ./release.sh 1.2.3
4+
# Assumes version is set in pyproject.toml or setup.cfg
5+
6+
set -e
7+
8+
VERSION=$1
9+
10+
if [[ -z "$VERSION" ]]; then
11+
echo "❌ Error: No version number supplied."
12+
echo "👉 Usage: ./release.sh 1.2.3"
13+
exit 1
14+
fi
15+
16+
TAG="v$VERSION"
17+
18+
# Confirm version bump is in code
19+
echo "📦 Preparing release: $TAG"
20+
grep "$VERSION" pyproject.toml || {
21+
echo "❌ Version $VERSION not found in pyproject.toml. Did you forget to bump it?"
22+
exit 1
23+
}
24+
25+
# Commit the version bump
26+
git add -A
27+
git commit -m "Release $TAG"
28+
29+
# Create tag
30+
git tag "$TAG"
31+
32+
# Push commit and tag
33+
git push origin main
34+
git push origin "$TAG"
35+
36+
echo "✅ Release $TAG pushed! GitHub Actions will handle the rest."

0 commit comments

Comments
 (0)