#!/bin/bash

# Get current version
VERSION_NUMBER=$(cat "VERSION")

# Create dist
echo "Creating source distribution for binarycpython-$VERSION_NUMBER"
python setup.py sdist

# Checking validity
echo ""
echo "Checking validity of for binarycpython-$VERSION_NUMBER source distribution:"
twine check dist/binarycpython-$VERSION_NUMBER.tar.gz

echo "Uploading binarcpython version $VERSION_NUMBER to pypi."
read -p "Continue? y/n " -n 1 -r
echo    # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
    twine upload check dist/binarycpython-$VERSION_NUMBER.tar.gz
fi
