if [[ "$1" == "prod" ]]
then
    urlrepo="https://upload.pypi.org/legacy/"
else
    urlrepo="https://test.pypi.org/legacy/"
fi

rm -rf dist/*

set -x
python3 setup.py sdist  && twine check dist/* && twine upload --repository-url $urlrepo dist/*
set +x
