Skip to content

Commit 4632a35

Browse files
helper release script
1 parent dd3608c commit 4632a35

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dist
1010
build
1111
eggs
1212
parts
13-
bin
1413
var
1514
sdist
1615
develop-eggs

bin/release

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash -ex
2+
3+
VERSION="$1"
4+
VERSION_FILE=socketio/__init__.py
5+
6+
if [[ "$VERSION" == "" ]]; then
7+
echo "Usage: $0 <version>"
8+
fi
9+
10+
sed -i "" "s/^__version__ = '.*'$/__version__ = '$VERSION'/" $VERSION_FILE
11+
rm -rf dist
12+
pip install --upgrade pip wheel twine
13+
python setup.py sdist bdist_wheel --universal
14+
15+
git add $VERSION_FILE
16+
git commit -m "Release $VERSION"
17+
git tag -f v$VERSION
18+
git push --tags origin master
19+
20+
read -p "Press any key to submit to PyPI or Ctrl-C to abort..." -n1 -s
21+
twine upload dist/*
22+
23+
NEW_VERSION="${VERSION%.*}.$((${VERSION##*.}+1))dev"
24+
sed -i "" "s/^__version__ = '.*'$/__version__ = '$NEW_VERSION'/" $VERSION_FILE
25+
git add $VERSION_FILE
26+
git commit -m "Version $NEW_VERSION"
27+
git push origin master
28+
echo "Development is now open on version $NEW_VERSION!"

0 commit comments

Comments
 (0)