Skip to content

Commit

Permalink
Add testpypi release
Browse files Browse the repository at this point in the history
  • Loading branch information
tankywoo committed Apr 9, 2016
1 parent 09039e1 commit 37bc049
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions release.sh
@@ -1,8 +1,24 @@
#!/bin/bash

DO_TEST=false

while [[ $# > 0 ]]; do
case "$1" in
-t | --test) DO_TEST=true; shift;;
--) shift; break;;
*) echo "$0 with wrong args!"; exit 1;;
esac
done

README_MD="README.md"
README_RST="README.rst"

if [ "$DO_TEST" = true ]; then
INDEX='testpypi' # defined in ~/.pypirc index-servers
else
INDEX='pypi'
fi

# Convert README.md to README.rst using pandoc
if [ `which pandoc` ]; then
pandoc -f markdown -t rst -o ${README_RST} ${README_MD} && echo "Convert md to rst ok."
Expand All @@ -11,10 +27,10 @@ else
fi

# Release
read -p "Release? (y/n) " RESP
read -p "Release [$INDEX]? (y/n) " RESP
if [ "$RESP" = "y" ]; then
echo "Begin to release"
python setup.py release
python setup.py release -r $INDEX
else
echo "Cancel to release"
fi
Expand All @@ -23,6 +39,8 @@ fi
rm ${README_RST}
rm -rf build dist simiki.egg-info

# Add tag to HEAD
version=`python -m simiki.cli --version | awk {'printf $2'}`
git tag v${version}
if [ "$DO_TEST" = false ]; then
# Add tag to HEAD
version=`python -m simiki.cli --version | awk {'printf $2'}`
git tag v${version}
fi

0 comments on commit 37bc049

Please sign in to comment.