Skip to content

Commit 0f753be

Browse files
committed
Merge branch 'publish-script'
2 parents 42df9d0 + ea0cec5 commit 0f753be

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

publish.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Publishes package to pypi and creates git tags.
4+
# Reads version from VERSION file.
5+
#
6+
# To register a package (before first publish):
7+
# python setup.py register
8+
9+
version=`cat VERSION`
10+
changelog=CHANGELOG.md
11+
grep $version $changelog >> /dev/null
12+
if [[ $? -ne 0 ]]; then
13+
echo "Couldn't find version $version in $changelog"
14+
exit
15+
fi
16+
17+
read -p "Publish and tag as v$version? " -n 1 -r
18+
if [[ $REPLY =~ ^[Yy]$ ]]; then
19+
# publish to pypi
20+
python setup.py sdist upload
21+
22+
# create git tags
23+
git tag -a v$version -m "version $version"
24+
git push --tags
25+
fi

0 commit comments

Comments
 (0)