| 1 | --- |
| 2 | name: Upload Python Package |
| 3 | |
| 4 | on: |
| 5 | release: |
| 6 | types: [published] |
| 7 | |
| 8 | permissions: |
| 9 | contents: read |
| 10 | |
| 11 | jobs: |
| 12 | deploy: |
| 13 | runs-on: ubuntu-latest |
| 14 | |
| 15 | steps: |
| 16 | - uses: actions/checkout@v4 |
| 17 | - name: Set up Python |
| 18 | uses: actions/setup-python@v5 |
| 19 | with: |
| 20 | python-version: '3.x' |
| 21 | - name: Install dependencies |
| 22 | run: | |
| 23 | python -m pip install --upgrade pip |
| 24 | pip install build |
| 25 | - name: Build package |
| 26 | run: python -m build |
| 27 | - name: Publish package |
| 28 | uses: pypa/[email protected] |
| 29 | with: |
| 30 | user: __token__ |
| 31 | password: ${{ secrets.PYPI_API_TOKEN }} |