File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ python-version : ["3.10", "3.11", "3.12"]
15+
16+ steps :
17+ - uses : actions/checkout@v4
18+
19+ - name : Set up Python ${{ matrix.python-version }}
20+ uses : actions/setup-python@v5
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+
24+ - name : Install dependencies
25+ run : |
26+ pip install -e ".[dev]"
27+
28+ - name : Run tests
29+ run : |
30+ python -m pytest tests/ -v --cov=src --cov-report=term-missing
Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ release :
5+ types : [published]
6+ workflow_dispatch :
7+ inputs :
8+ pypi_target :
9+ description : ' PyPI target (pypi or testpypi)'
10+ default : ' testpypi'
11+ type : choice
12+ options :
13+ - pypi
14+ - testpypi
15+
16+ jobs :
17+ build-and-publish :
18+ runs-on : ubuntu-latest
19+ permissions :
20+ contents : read
21+ id-token : write
22+
23+ steps :
24+ - uses : actions/checkout@v4
25+
26+ - name : Set up Python 3.11
27+ uses : actions/setup-python@v5
28+ with :
29+ python-version : " 3.11"
30+
31+ - name : Install build deps
32+ run : |
33+ pip install build twine
34+
35+ - name : Build package
36+ run : |
37+ python -m build
38+
39+ - name : Publish to PyPI
40+ if : ${{ inputs.pypi_target != 'testpypi' || github.event_name == 'release' }}
41+ env :
42+ TWINE_USERNAME : __token__
43+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
44+ run : |
45+ twine upload dist/* --verbose
46+
47+ - name : Publish to TestPyPI
48+ if : ${{ inputs.pypi_target == 'testpypi' }}
49+ env :
50+ TWINE_USERNAME : __token__
51+ TWINE_PASSWORD : ${{ secrets.TEST_PYPI_API_TOKEN }}
52+ run : |
53+ twine upload --repository testpypi dist/* --verbose
Original file line number Diff line number Diff line change 1+ __pycache__ /
2+ * .pyc
3+ * .pyo
4+ .env
5+ .venv /
6+ venv /
7+ dist /
8+ * .egg-info /
9+ .pytest_cache /
10+ .coverage
11+ htmlcov /
You can’t perform that action at this time.
0 commit comments