diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e97fb1..cb93808 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,10 @@ name: Build and publish on: + pull_request: + branches: [main] push: + branches: [main] tags: - "v*" workflow_dispatch: @@ -22,7 +25,7 @@ jobs: - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 with: - version: "0.12.1" + version: "0.12.21" python-version: "3.14.7" - name: Run tests @@ -40,7 +43,7 @@ jobs: path: dist/ publish-testpypi: - # Tag pushes and manual runs on v* tags can publish; branch runs only build. + # Tag pushes and manual runs on v* tags can publish; branch and PR runs only build. if: startsWith(github.ref, 'refs/tags/v') needs: build runs-on: ubuntu-latest diff --git a/README.md b/README.md index a960865..548d506 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,10 @@ print(cost.total_cost) # 0.045 Uses [uv](https://docs.astral.sh/uv/). `make localdev` sets things up, `make test` runs the tests, and `make dist` builds. +GitHub Actions runs the tests and builds packages for PRs targeting `main` +and pushes to `main`, without publishing. Maintainer approval is required +to run outside contributors' PR workflows. + Pushing a `v*` tag makes GitHub Actions build it and publish to TestPyPI, then PyPI. Manually running the workflow on a `v*` tag does the same, including publishing to real PyPI. Manual branch runs just run the checks