deploy.yaml 1.4 KB

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