| 1 | # This workflow will upload a Python Package using Twine when a release is created |
| 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries |
| 3 | |
| 4 | name: Upload Python Package |
| 5 | |
| 6 | on: |
| 7 | release: |
| 8 | types: [published] |
| 9 | |
| 10 | permissions: |
| 11 | contents: read |
| 12 | |
| 13 | jobs: |
| 14 | deploy: |
| 15 | |
| 16 | runs-on: ubuntu-latest |
| 17 | |
| 18 | steps: |
| 19 | - uses: actions/checkout@v3 |
| 20 | - name: Set up Python |
| 21 | uses: actions/setup-python@v3 |
| 22 | with: |
| 23 | python-version: '3.10' |
| 24 | - name: Install dependencies |
| 25 | run: | |
| 26 | python -m pip install --upgrade pip |
| 27 | pip install build |
| 28 | - name: Build package |
| 29 | run: python -m build |
| 30 | - name: Publish package |
| 31 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 |
| 32 | with: |
| 33 | user: __token__ |
| 34 | password: ${{ secrets.PYPI_API_TOKEN }} |
| 35 | packages_dir: dist |