chore: release v1.1.4 — version alignment and maintainability cleanup #19
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 distribution to PyPI | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Fires when a tag is pushed via `git push` | |
| release: | |
| types: [published] # Fires when a release is published via the GitHub web UI | |
| workflow_dispatch: # Adds a "Run workflow" button on the Actions tab | |
| inputs: | |
| ref: | |
| description: 'Tag or branch to publish from (e.g. v1.1.3)' | |
| required: false | |
| default: '' | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # For workflow_dispatch with a user-supplied ref, check that out; | |
| # otherwise fall back to the default ref the event was fired against. | |
| ref: ${{ github.event.inputs.ref || github.ref }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install build tools | |
| run: python -m pip install --upgrade build twine | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| # `--skip-existing` makes the upload idempotent — re-running for the | |
| # same version won't fail if it's already on PyPI. Useful when both | |
| # `push: tags` and `release: published` fire for the same tag. | |
| run: twine upload --skip-existing dist/* |