File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Publish to PyPI
22
3- # Manual trigger only — packages published via uv publish
43on :
54 workflow_dispatch :
65
7- permissions :
8- id-token : write
9-
106jobs :
11- publish :
7+ test-build- publish :
128 runs-on : ubuntu-latest
13- environment : pypi
9+ timeout-minutes : 20
1410 steps :
1511 - uses : actions/checkout@v4
12+
1613 - uses : actions/setup-python@v5
1714 with :
1815 python-version : " 3.12"
19- - name : Install build tools
20- run : pip install build
21- - name : Build package
22- run : python -m build
16+
17+ - name : Install dependencies
18+ run : |
19+ python -m pip install --upgrade pip
20+ pip install -e ".[dev]" || pip install -e ".[test]" || pip install -e .
21+
22+ - name : Run tests
23+ run : |
24+ if [ -d tests ]; then
25+ python -m pytest tests/ -q --tb=short --timeout=120
26+ else
27+ echo "No tests directory — skipping"
28+ fi
29+
30+ - name : Build
31+ run : |
32+ pip install build
33+ python -m build
34+
2335 - name : Publish to PyPI
24- uses : pypa/gh-action-pypi-publish@release/v1
36+ env :
37+ TWINE_USERNAME : __token__
38+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
39+ run : |
40+ pip install twine
41+ twine upload --skip-existing dist/*
You can’t perform that action at this time.
0 commit comments