-
Notifications
You must be signed in to change notification settings - Fork 0
/
do
executable file
·41 lines (30 loc) · 1.02 KB
/
do
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
40
41
#!/bin/bash
set -e
SRC=$(dirname $0)
cd $SRC
ARG=${1:-""}
case $ARG in
release)
CURRENT_VERSION=$(cat pyproject.toml| grep version | cut -d '"' -f 2)
echo Current version $CURRENT_VERSION
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1 "." $2+1 "." $3}')
echo New version $NEW_VERSION
poetry version $NEW_VERSION
git add -u pyproject.toml
git commit -m "Release v$NEW_VERSION"
git tag v$NEW_VERSION
poetry build
poetry publish -u $(pass show i/pypi | grep username | cut -d ' ' -f 2 | tr -d '\n') -p $(pass show i/pypi | head -n 1 | tr -d '\n')
git log --pretty=format:"%cn: %s" v$CURRENT_VERSION...v$NEW_VERSION | grep -v -e "Merge" | grep -v "Release"| awk '!x[$0]++' > changelog.md
git push origin master --tags
gh release create v$NEW_VERSION -F changelog.md
rm changelog.md
;;
check)
black .
isort tg/*.py
;;
*)
poetry run python3 main.py
;;
esac