-
-
Notifications
You must be signed in to change notification settings - Fork 98
/
build.sh
executable file
·50 lines (40 loc) · 967 Bytes
/
build.sh
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
47
48
49
50
#!/bin/bash
VERSION=8
MINOR=3
PATCH=2
EXTRAVERSION=""
NOTES="(#315 #316)"
BRANCH="main"
if [[ -z $PATCH ]]; then
PATCH=""
else
PATCH=".$PATCH"
fi
if [[ $EXTRAVERSION == *"-rc"* ]]; then
FULL_VERSION="$VERSION.$MINOR$PATCH$EXTRAVERSION"
else
if [[ -z $EXTRAVERSION ]]; then
FULL_VERSION="$VERSION.$MINOR$PATCH"
else
FULL_VERSION="$VERSION.$MINOR$PATCH.$EXTRAVERSION"
fi
fi
git add .
git commit -m "$FULL_VERSION $NOTES"
git push -u origin $BRANCH
git tag v$FULL_VERSION
git push --tags
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.DS_Store' -exec rm -f {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
pip install twine build
python -m build
twine upload dist/*
echo "Build $FULL_VERSION completed successfully!"