pythonasyncioeventletgeventlong-pollinglow-latencysocket-iosocketiosocketio-serverweb-serverwebsocket
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
#!/bin/bash -ex
|
|
|
|
VERSION="$1"
|
|
VERSION_FILE=socketio/__init__.py
|
|
|
|
if [[ "$VERSION" == "" ]]; then
|
|
echo "Usage: $0 <version>"
|
|
exit 1
|
|
fi
|
|
|
|
# update change log
|
|
head -n 2 CHANGES.md > _CHANGES.md
|
|
echo "**Release $VERSION** - $(date +%F)" >> _CHANGES.md
|
|
echo "" >> _CHANGES.md
|
|
pip install gitpython
|
|
python bin/mkchangelog.py >> _CHANGES.md
|
|
echo "" >> _CHANGES.md
|
|
len=$(wc -l < CHANGES.md)
|
|
tail -n $(expr $len - 2) CHANGES.md >> _CHANGES.md
|
|
vim _CHANGES.md
|
|
set +e
|
|
grep -q ABORT _CHANGES.md
|
|
if [[ "$?" == "0" ]]; then
|
|
rm _CHANGES.md
|
|
echo "Aborted."
|
|
exit 1
|
|
fi
|
|
set -e
|
|
mv _CHANGES.md CHANGES.md
|
|
|
|
sed -i "" "s/^__version__ = '.*'$/__version__ = '$VERSION'/" $VERSION_FILE
|
|
rm -rf dist
|
|
pip install --upgrade pip wheel twine
|
|
python setup.py sdist bdist_wheel --universal
|
|
|
|
git add $VERSION_FILE CHANGES.md
|
|
git commit -m "Release $VERSION"
|
|
git tag -f v$VERSION
|
|
git push --tags origin master
|
|
|
|
read -p "Press any key to submit to PyPI or Ctrl-C to abort..." -n1 -s
|
|
twine upload dist/*
|
|
|
|
NEW_VERSION="${VERSION%.*}.$((${VERSION##*.}+1))dev"
|
|
sed -i "" "s/^__version__ = '.*'$/__version__ = '$NEW_VERSION'/" $VERSION_FILE
|
|
git add $VERSION_FILE
|
|
git commit -m "Version $NEW_VERSION"
|
|
git push origin master
|
|
echo "Development is now open on version $NEW_VERSION!"
|
|
|