Files
pypi_publish/action.sh
T
bryce fa55659004
Push to main / Reset-Version-Tag (push) Successful in 6s
init version
2026-05-14 10:55:18 -06:00

36 lines
711 B
Bash

#!/bin/bash
### INSTALL UV, PYTHON, AND DEPS ###
wget -qO- https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
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*