-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·46 lines (41 loc) · 1.09 KB
/
deploy
File metadata and controls
executable file
·46 lines (41 loc) · 1.09 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
40
41
42
43
44
45
46
DIR=`pwd`
PROJECT_DIR=`basename $DIR`
PROJECT="`echo $PROJECT_DIR | tr '-' '_'`"
REL="`parse-pyproject-version.py --patch`"
git add -A pyproject.toml
git commit -m 'version bump'
if [ "$?" != "0" ]; then
REL=""
fi
if [ -z "$1" ] && [ "$REL" == "" ]; then
echo "Usage: <release version>"
exit 1
fi
if [ -z "$REL" ]; then
REL="$1"
fi
echo "Making release $REL of $PROJECT"
rm -rf dist htmlcov buyild MANIFEST *.egg-info
./venv/bin/python -m build
if [ "$?" != "0" ]; then
echo "ERROR: ./venv/bin/python -m build failed, exiting"
exit
fi
# clean venv/ and htmlcov/ directories from the dist
cd dist
FILE="$PROJECT-$REL"
echo $FILE
tar xvf "$FILE.tar.gz"
for DIR_TO_BE_DELETED in venv uploads downloads certs .idea coverage.xml project logs .mypy_cache linecalc.conf mypy.ini pyproject.toml requirements-dev.txt; do
rm -rf "$FILE/$DIR_TO_BE_DELETED"
done
find . -name "__pycache__" -type d -exec rm -r "{}" \;
rm "$FILE.tar.gz"
rm "*.whl"
cp ../pyproject.toml $FILE/
tar zcvf "$FILE.tar.gz" $FILE
rm -rf $FILE
cd ..
if [ "$1" != "--no-upload" ]; then
twine upload dist/$FILE.tar.gz
fi