Add release workflow #2
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-on-main | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| release: | |
| if: "!startsWith(github.event.head_commit.message, 'chore(release):')" | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.10.4" | |
| - run: uv version --bump patch | |
| - run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add pyproject.toml uv.lock | |
| if ! git diff --staged --quiet; then | |
| git commit -m "chore(release): bump version [skip ci]" | |
| git push | |
| fi | |
| - run: uv build --no-sources | |
| - run: uv publish |