v1.17.0 #59
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 Python Package | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Poetry | |
| run: | | |
| pip install poetry | |
| poetry config virtualenvs.create false | |
| - name: Configure Poetry repositories | |
| run: | | |
| # Configure TestPyPI | |
| poetry config repositories.testpypi https://test.pypi.org/legacy/ | |
| # Configure PyPI | |
| poetry config repositories.pypi https://upload.pypi.org/legacy/ | |
| - name: Build distributions | |
| run: poetry build | |
| - name: Upload to PyPI or TestPyPI | |
| env: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }} | |
| run: | | |
| # USE TESTPYPI | |
| # poetry publish --repository testpypi --username __token__ --password "$TESTPYPI_TOKEN" | |
| # ... OR ... | |
| # USE PYPI | |
| poetry publish --username __token__ --password "$PYPI_TOKEN" |