deploy.yaml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Publish cloudbridge to PyPI
  2. on:
  3. release:
  4. types: [published]
  5. push:
  6. tags:
  7. - '*'
  8. permissions:
  9. contents: read
  10. id-token: write # Required for trusted publishing to PyPI
  11. jobs:
  12. build-n-publish:
  13. name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
  14. runs-on: ubuntu-latest
  15. steps:
  16. - uses: actions/checkout@v6
  17. with:
  18. persist-credentials: false
  19. - name: Set up Python 3.13
  20. uses: actions/setup-python@v6
  21. with:
  22. python-version: 3.13
  23. - name: Install dependencies
  24. run: |
  25. python3 -m pip install --upgrade pip
  26. python3 -m pip install --upgrade build twine
  27. - name: Create and check packages
  28. run: |
  29. python3 -m build
  30. twine check dist/*
  31. ls -l dist
  32. - name: Publish distribution 📦 to Test PyPI
  33. uses: pypa/gh-action-pypi-publish@v1.14.0
  34. with:
  35. repository_url: https://test.pypi.org/legacy/
  36. skip_existing: true
  37. - name: Publish distribution 📦 to PyPI
  38. if: github.event_name == 'release'
  39. uses: pypa/gh-action-pypi-publish@v1.14.0