| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
name: Upload Python Package |
| 10 |
|
| 11 |
on: |
| 12 |
release: |
| 13 |
types: [published] |
| 14 |
|
| 15 |
permissions: |
| 16 |
contents: read |
| 17 |
|
| 18 |
jobs: |
| 19 |
deploy: |
| 20 |
runs-on: ubuntu-latest |
| 21 |
|
| 22 |
steps: |
| 23 |
- uses: actions/checkout@v4 |
| 24 |
- name: Set up Python |
| 25 |
uses: actions/setup-python@v5 |
| 26 |
with: |
| 27 |
python-version: "3.11" |
| 28 |
- name: Install dependencies |
| 29 |
run: | |
| 30 |
python -m pip install --upgrade pip |
| 31 |
pip install build |
| 32 |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 33 |
- name: Build package |
| 34 |
run: python -m build |
| 35 |
- name: Publish package |
| 36 |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 |
| 37 |
with: |
| 38 |
user: __token__ |
| 39 |
password: ${{ secrets.PYPI_API_TOKEN }} |