diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..49e4b59 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + tags: + # Publish on any tag starting with a `v`, e.g. v1.2.3 + - v* + +jobs: + pypi: + name: Publish to PyPI + runs-on: ubuntu-latest + # Environment and permissions trusted publishing. + environment: + # Create this environment in the GitHub repository under Settings -> Environments + name: pypi + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 + with: + version: "latest" + enable-cache: true + - run: uv build + # Check that basic features work and we didn't miss to include crucial files + - name: Smoke test (wheel) + run: uv run --isolated --no-project -p 3.13 --with dist/*.whl tests/smoke_test.py + # - name: Smoke test (source distribution) + # run: uv run --isolated --no-project -p 3.13 --with dist/*.tar.gz tests/smoke_test.py + - run: uv publish --trusted-publishing always