feat: implement dynamic version management using hatch #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 Python Package to PyPI | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Trigger on version tags like v1.0.0 | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| # Enable OIDC token permissions for Trusted Publisher | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Upgrade pip | |
| run: python -m pip install --upgrade pip | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Build the package | |
| run: python -m build | |
| - name: Publish package distributions to PyPI using Trusted Publisher | |
| # This action uses OIDC to authenticate without API tokens | |
| uses: pypa/gh-action-pypi-publish@release/v1 |