-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease_alpha_minor.sh
44 lines (36 loc) · 1.13 KB
/
release_alpha_minor.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
#-----------------------------------------------------------------------------
#
# Name: release_alpha_minor
# Description:
# Creates an alpha minor release for the diyr project by:
# 1. Updating setup.py with the next minor number
# 2. Rebuilding wheels
# 3. Uploading package to pypi via twine
# Author: Alex Cantu
# Date: 03/17/2019
#
#
#-----------------------------------------------------------------------------
# MAIN -----------------------------------------------------------------------
## Obtaining next version
CURRENT_VERSION=`cat setup.py | grep -E 'a[0-9]+' -o | head -n1 | sed 's/a//g'`
NEXT_VERSION=$(( CURRENT_VERSION + 1 ))
echo "Next version is: ${NEXT_VERSION}"
if ! [[ -f setup.py ]]; then
exit
fi
# Update version number in setup.py
sed "s/a[0-9][0-9]/a${NEXT_VERSION}/g" setup.py -i
# Remove build and dist directories
rm -rf build/
rm -rf dist/
# Build new wheel
python setup.py bdist_wheel
# Making git tag
git add setup.py
git commit -m "Prepare setup,py for Alpha Release ${NEXT_VERSION}"
git push
git tag 0.0.1a${NEXT_VERSION} -m "Alpha Release ${NEXT_VERSION}"
git push --tags
# Upload to PyPI
twine upload dist/*