2017-01-02 21:04:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Pushes a new version to PyPi.
|
|
|
|
|
2015-09-20 18:00:35 +00:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2016-12-13 06:18:20 +00:00
|
|
|
head -n 5 homeassistant/const.py | tail -n 1 | grep PATCH_VERSION > /dev/null
|
|
|
|
|
|
|
|
if [ $? -eq 1 ]
|
|
|
|
then
|
|
|
|
echo "Patch version not found on const.py line 5"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
head -n 5 homeassistant/const.py | tail -n 1 | grep dev > /dev/null
|
2015-09-20 18:00:35 +00:00
|
|
|
|
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "Release version should not contain dev tag"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
|
|
|
|
2018-03-23 21:27:05 +00:00
|
|
|
if [ "$CURRENT_BRANCH" != "master" ] && [ "$CURRENT_BRANCH" != "rc" ]
|
2015-09-20 18:00:35 +00:00
|
|
|
then
|
2018-03-23 21:27:05 +00:00
|
|
|
echo "You have to be on the master or rc branch to release."
|
2015-09-20 18:00:35 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-01-21 01:31:09 +00:00
|
|
|
rm -rf dist build
|
2018-03-26 23:16:42 +00:00
|
|
|
python3 setup.py sdist bdist_wheel
|
|
|
|
python3 -m twine upload dist/* --skip-existing
|