Skip to content

Commit 57bbb5d

Browse files
committed
Update release scripts
1 parent 349ce15 commit 57bbb5d

File tree

3 files changed

+51
-21
lines changed

3 files changed

+51
-21
lines changed

release-finish.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/bash
2+
set -e
3+
4+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
5+
if [[ $CURRENT_BRANCH != release/* ]]; then
6+
echo "You have to be on release branch to finish the release"
7+
exit 1
8+
fi
9+
10+
NEW_VERSION=$(poetry version --short)
11+
12+
pytest
13+
mypy
14+
15+
git commit -a -m "Version v$NEW_VERSION"
16+
git tag "v$NEW_VERSION"
17+
git flow release finish
18+
19+
20+
confirm() {
21+
QUESTION=$1
22+
read -rp "$QUESTION (y/n): " RESPONSE
23+
case $RESPONSE in
24+
[Yy]* ) return 0;;
25+
[Nn]* ) return 1;;
26+
* ) echo "Please answer y or n." && confirm "$QUESTION" ;;
27+
esac
28+
}
29+
30+
if confirm "Do you want to push the changes?"; then
31+
git push
32+
git push --tags
33+
else
34+
echo "To publish:"
35+
echo " git push && git push --tags"
36+
fi

release-start.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/bash
2+
set -e
3+
4+
BUMP_RULE=$1
5+
if [ -z "$BUMP_RULE" ]; then
6+
echo "Please specify bump rule: major, minor or patch"
7+
exit 1
8+
fi
9+
10+
NEXT_VERSION=$(poetry version --dry-run --short "$BUMP_RULE")
11+
12+
git flow release start "v$NEXT_VERSION"
13+
poetry version "$BUMP_RULE"
14+
15+
echo "Type release-finish.sh to make the release"

release.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)