publish.yml 869 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: PyPI Publish
  2. on:
  3. push:
  4. tags:
  5. # Publish on any tag starting with a `v`, e.g., v0.1.0
  6. - v*
  7. workflow_dispatch:
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@v5
  17. - name: Build and smoke test
  18. uses: ./.github/actions/uv-build
  19. with:
  20. python-version: ${{ matrix.python-version }}
  21. publish:
  22. runs-on: ubuntu-latest
  23. needs: build
  24. environment:
  25. name: pypi
  26. permissions:
  27. id-token: write
  28. contents: read
  29. steps:
  30. - name: Checkout
  31. uses: actions/checkout@v5
  32. - name: Build and smoke test
  33. uses: ./.github/actions/uv-build
  34. with:
  35. python-version: '3.12'
  36. - name: Publish
  37. run: uv publish