| 1 | name: Upload Python Package |
| 2 | |
| 3 | on: |
| 4 | release: |
| 5 | types: [created] |
| 6 | |
| 7 | jobs: |
| 8 | deploy: |
| 9 | runs-on: ubuntu-latest |
| 10 | steps: |
| 11 | - uses: actions/checkout@v4 |
| 12 | - name: Set up Python |
| 13 | uses: actions/setup-python@v5 |
| 14 | with: |
| 15 | python-version: '3.x' |
| 16 | - name: Install dependencies |
| 17 | run: | |
| 18 | python -m pip install --upgrade pip |
| 19 | pip install setuptools wheel twine |
| 20 | - name: Build and publish |
| 21 | env: |
| 22 | TWINE_USERNAME: __token__ |
| 23 | TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
| 24 | run: | |
| 25 | python setup.py sdist bdist_wheel |
| 26 | twine upload dist/* |