36 lines
711 B
Bash
Executable File
36 lines
711 B
Bash
Executable File
#!/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* |