@@ -3,13 +3,10 @@ name: Build & Deploy to PyPI
33on :
44 workflow_dispatch :
55 inputs :
6- environment :
7- description : Deployment environment
8- required : true
9- type : choice
10- options :
11- - test
12- - production
6+ note :
7+ description : ' This workflow publishes to TestPyPI only. For production, create a GitHub Release.'
8+ required : false
9+ default : ' '
1310
1411 release :
1512 types : [published]
@@ -51,31 +48,19 @@ jobs:
5148 echo "Tag version: $TAG_VERSION"
5249 uv version $TAG_VERSION
5350
54- - name : Generate HTML documentation 📚
55- if : github.event_name == 'release' || inputs.environment == 'production'
56- run : |
57- uv sync --all-groups --frozen
58- uv pip install -e .
59- uv run pdoc --html -f -o ./docs keboola.component
60- mv ./docs/keboola/component/* docs
61- rm -r ./docs/keboola
62-
6351 - name : Build package 📦
6452 run : |
6553 uv build
6654
67- - name : Publish to PyPI 🚀
55+ - name : Publish to TestPyPI 🧪
6856 env :
69- UV_PUBLISH_TOKEN : ${{ inputs.environment == 'test' && secrets.UV_PUBLISH_TOKEN_TEST_PYPI || secrets.UV_PUBLISH_TOKEN }}
57+ UV_PUBLISH_TOKEN : ${{ secrets.UV_PUBLISH_TOKEN_TEST_PYPI }}
7058 run : |
71- uv publish ${{ inputs.environment == 'test' && ' --index testpypi' || '' }}
59+ uv publish --index testpypi
7260
73- - name : Commit documentation 📝
74- if : github.event_name == 'release' || inputs.environment == 'production'
61+ - name : Publish to PyPI 🚀
62+ if : github.event_name == 'release'
63+ env :
64+ UV_PUBLISH_TOKEN : ${{ secrets.UV_PUBLISH_TOKEN }}
7565 run : |
76- TAG_VERSION=${GITHUB_REF#refs/tags/}
77- git config --global user.name 'KCF'
78- git config --global user.email 'kcf@users.noreply.github.com'
79- git add docs
80- git commit -m "docs: update for release $TAG_VERSION 📚" || echo "No changes to commit"
81- git push
66+ uv publish
0 commit comments