Skip to content

Commit

Permalink
Don't try to publish the tag twice
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagnoux committed May 15, 2018
1 parent c97f071 commit 155cfe3
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions deploy-if-version-bump.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/bin/sh

set -e
if ! git rev-parse `python setup.py --version` 2>/dev/null ; then
git tag `python setup.py --version`
git push --tags # update the repository version
python setup.py bdist_wheel # build this package in the dist directory
twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD # publish
else
echo "No deployment - Only non-functional elements were modified in this change"
if [ $PY_VERSION = "2" ]; then
if ! git rev-parse `python setup.py --version` 2>/dev/null ; then
git tag `python setup.py --version`
git push --tags # update the repository version
python setup.py bdist_wheel # build this package in the dist directory
twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD # publish
else
echo "No deployment - Only non-functional elements were modified in this change"
fi
fi

if [ $PY_VERSION = "3" ]; then
python setup.py bdist_wheel # build this package in the dist directory
if ! twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD; then # publish
echo "Could not upload this package version on Pypi. This usually means that the version already exists, and that only non-functional elements were modified in this change. If this it not the case, check the error message above."
fi
fi

0 comments on commit 155cfe3

Please sign in to comment.