-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.sh
executable file
·69 lines (62 loc) · 2.14 KB
/
upload.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
echo
echo '******************************************************************************'
echo '* Ensuring that pip build requirements are installed and upgraded.'
pip install --upgrade --requirement requirements.txt
echo
echo '******************************************************************************'
echo '* Get old version from setup.py'
OLDVERSION=$(grep version setup.py | sed -e "s/.*='//" -e "s/',//")
echo
echo '******************************************************************************'
echo '* Ready to update setup.py?'
echo '* Press [ENTER] to continue (cntrl-c to quit)'
read ANS
vi setup.py
VERSION=$(grep version setup.py | sed -e "s/.*='//" -e "s/',//")
if [[ $OLDVERSION == $VERSION ]]; then
echo
echo '******************************************************************************'
echo "* Old version $OLDVERSION same as $VERSION"
echo '* Press [ENTER] to continue (cntrl-c to quit)'
read ANS
else
echo
echo '******************************************************************************'
echo "* Ready to push $VERSION to GitHub?"
echo '* Press [ENTER] to continue (cntrl-c to quit)'
read ANS
git tag -a $VERSION -m v$VERSION
gitchangelog
vi CHANGELOG.rst
git commit -m "Version $VERSION" CHANGELOG.rst setup.py
git push origin master
git tag --force -a $VERSION -m v$VERSION
git push origin --tags
fi
echo
echo '******************************************************************************'
echo "* Ready to build $VERSION?"
echo '* Press [ENTER] to continue (cntrl-c to quit)'
read ANS
if [[ -d dist ]]; then
rm -rf dist
fi
python setup.py sdist bdist_wheel
twine check dist/*
echo
echo '******************************************************************************'
echo "* Ready to tox test $VERSION?"
echo '* Press [ENTER] to continue (cntrl-c to quit)'
read ANS
tox
echo
echo '******************************************************************************'
echo "* Ready to push $VERSION to TestPyPI?"
echo '* Press [ENTER] to continue (cntrl-c to quit)'
read ANS
if [[ ! -f ~/.pypirc ]]; then
echo 'no ~/.pypirc exist!'
exit 1
fi
twine upload dist/* -r ansible-filters-ldif-test