chore: add github actions for pr quality gate and auto-release #1
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: Auto Release & Publish | |
| on: | |
| push: | |
| branches: [master] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # MANDATORY for PyPI Trusted Publishing | |
| contents: write # MANDATORY for Semantic Release to push tags/commits | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required to read the git commit history | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Python Semantic Release | |
| id: semantic | |
| uses: python-semantic-release/python-semantic-release@v9 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # The step above automatically runs `uv build` (because we set it in pyproject.toml) | |
| # BUT it only does this IF there are commits that trigger a release (feat:, fix:, etc.) | |
| - name: Publish to PyPI | |
| if: steps.semantic.outputs.released == 'true' | |
| run: uv publish |