#!/bin/sh
# Pushes a new version to PyPi.

cd "$(dirname "$0")/.."

CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`

if [ "$CURRENT_BRANCH" != "master" ]
then
  echo "You have to be on the master to release."
  exit 1
fi

rm -rf dist
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/* --skip-existing
