Publish package on PyPI #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish package on PyPI | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" # Triggers the workflow on version tags (e.g., v1.0.0) | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| pip install hatch | |
| - name: Build package | |
| run: hatch build | |
| # - name: Publish package to PyPI | |
| # env: | |
| # TWINE_USERNAME: __token__ | |
| # TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| # run: hatch publish --user __token__ | |
| - name: Publish package to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| python -m pip install twine | |
| python -m twine upload dist/* |