Skip to content

Instantly share code, notes, and snippets.

@ericoporto
Last active September 15, 2016 00:21
Show Gist options
  • Save ericoporto/6fabddba08c8d50eb554494ff4c1abd0 to your computer and use it in GitHub Desktop.
Save ericoporto/6fabddba08c8d50eb554494ff4c1abd0 to your computer and use it in GitHub Desktop.
Use `tagandpypi.sh 'tag message'` to create a tag for current version and send the result to pypi (uses Twine to preven MITM)
#!/bin/bash
MESSAGE=$1
VERSION=`grep __version__ */__init__.py | cut -d= -f2 | tr -d '[[:space:]]'`
git tag $VERSION -m $MESSAGE
git push --tags origin master
python3 setup.py sdist
LATESTDIST=`ls -td dist/* | head -1`
twine register $LATESTDIST
twine upload dist/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment