File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,11 +27,25 @@ build:
2727 uv build
2828
2929publish : build
30- @if [ -z " $$ {PYPI_API_TOKEN}" ]; then \
31- echo " PYPI_API_TOKEN is not set" ; \
30+ @# Load local environment if present
31+ @set -e; \
32+ if [ -f .env ]; then set -a; . ./.env; set +a; fi ; \
33+ if [ -n " $$ {UV_PUBLISH_TOKEN:-}" ]; then \
34+ echo " Publishing with token (UV_PUBLISH_TOKEN)" ; \
35+ uv publish --token " $$ {UV_PUBLISH_TOKEN}" ; \
36+ elif [ -n " $$ {PYPI_API_TOKEN:-}" ]; then \
37+ echo " Publishing with token (PYPI_API_TOKEN)" ; \
38+ uv publish --token " $$ {PYPI_API_TOKEN}" ; \
39+ elif [ -n " $$ {UV_PUBLISH_USERNAME:-}" ] && [ -n " $$ {UV_PUBLISH_PASSWORD:-}" ]; then \
40+ echo " Publishing with username/password (UV_PUBLISH_USERNAME)" ; \
41+ uv publish --username " $$ {UV_PUBLISH_USERNAME}" --password " $$ {UV_PUBLISH_PASSWORD}" ; \
42+ elif [ -n " $$ {PYPI_USERNAME:-}" ] && [ -n " $$ {PYPI_PASSWORD:-}" ]; then \
43+ echo " Publishing with username/password (PYPI_USERNAME)" ; \
44+ uv publish --username " $$ {PYPI_USERNAME}" --password " $$ {PYPI_PASSWORD}" ; \
45+ else \
46+ echo " No credentials found. Set UV_PUBLISH_TOKEN or PYPI_API_TOKEN, or UV_PUBLISH_USERNAME/UV_PUBLISH_PASSWORD (or PYPI_USERNAME/PYPI_PASSWORD)." ; \
3247 exit 1; \
3348 fi
34- uv publish --token " $$ PYPI_API_TOKEN"
3549
3650clean :
3751 rm -rf build dist * .egg-info .pytest_cache .mypy_cache .ruff_cache
You can’t perform that action at this time.
0 commit comments