#!/bin/bash ### INSTALL UV, PYTHON, AND DEPS ### wget -qO- https://astral.sh/uv/install.sh | sh source "$HOME/.local/bin/env" bash uv venv source .venv/bin/activate bash uv pip install build twine ### CONFIGURE PYPI ### config_template=' [distutils] index-servers = repo [repo] repository = {repository} username = {username} password = {password} ' # Replace placeholders with environment variables config_output=$(echo "$config_template" | \ sed -e "s/{repository}/$PYPI_REPO_DOMAIN/g" \ -e "s/{username}/$PYPI_REPO_USER/g" \ -e "s/{password}/$PYPI_REPO_PASS/g") echo "$config_output" > "$HOME/.pypirc" ### BUILD PYPI PACKAGE ### python -m build ### PUBLISH PYPI PACKAGE ### python3 -m twine upload --repository repo ./dist*