#!/usr/bin/env bash

set -e

_version=$(git describe --exact-match --tags HEAD || echo $(poetry version -s).dev$(date +%Y%m%d))
VERSION=${_version#'v'} # remove prefixed 'v' if any
poetry version ${VERSION}
poetry build
poetry run twine upload dist/*.whl -u __token__ -p $BITIA_PYPI_TOKEN || echo "Failed to upload"
