carrot/teleoprtc_repo/scripts/publish_pypi.sh
Vehicle Researcher d64fb1838d openpilot v0.9.7 release
date: 2024-06-11T01:36:39
master commit: f8cb04e4a8b032b72a909f68b808a50936184bee
2024-06-11 16:32:27 -07:00

24 lines
410 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [[ -z "$1" ]]; then
echo "Usage: $0 <PyPI token>"
exit 1
fi
PYPI_TOKEN="$1"
# install required packages
pip install --upgrade twine build
# build the package
python3 -m build
# upload to PyPI
REPOSITORY=""
if [[ -n "$TEST_UPLOAD" ]]; then
REPOSITORY="--repository testpypi"
fi
python3 -m twine upload $REPOSITORY --username __token__ --password "$PYPI_TOKEN" dist/*