release to github (#120) #30
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: Release to PyPI and GitHub | |
| on: | |
| push: | |
| tags: ['v[0-9].[0-9]+.[0-9]+'] | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| environment: pypi-publish | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - 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_PASSWORD }} | |
| run: twine upload --skip-existing dist/* | |
| - name: Create GitHub Release | |
| if: matrix.python-version == '3.11' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| files: | | |
| dist/* | |
| generate_release_notes: true |