release: v1.0.10 #3
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
| # Create release AND publish to PyPI when a version tag is pushed | |
| # Combined into one workflow to avoid GITHUB_TOKEN limitation | |
| name: Release & Publish | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| jobs: | |
| release-and-publish: | |
| runs-on: ubuntu-latest | |
| environment: release # Required for PyPI trusted publishing | |
| permissions: | |
| contents: write # For creating releases | |
| id-token: write # For trusted PyPI publishing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build package | |
| run: python -m build | |
| - name: Check package | |
| run: twine check dist/* | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| files: | | |
| dist/*.whl | |
| dist/*.tar.gz | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |