deploy.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Publish cloudbridge to PyPI
  2. on:
  3. release:
  4. types: [published]
  5. push:
  6. tags:
  7. - '*'
  8. permissions:
  9. contents: read
  10. jobs:
  11. build-n-publish:
  12. name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v6
  16. with:
  17. persist-credentials: false
  18. - name: Set up Python 3.13
  19. uses: actions/setup-python@v6
  20. with:
  21. python-version: 3.13
  22. - name: Install dependencies
  23. run: |
  24. python3 -m pip install --upgrade pip setuptools
  25. python3 -m pip install --upgrade twine wheel
  26. - name: Create and check packages
  27. run: |
  28. python3 setup.py sdist bdist_wheel
  29. twine check dist/*
  30. ls -l dist
  31. - name: Publish distribution 📦 to Test PyPI
  32. uses: pypa/gh-action-pypi-publish@v1.14.0
  33. with:
  34. password: ${{ secrets.TEST_PYPI_API_TOKEN }}
  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
  40. with:
  41. password: ${{ secrets.PYPI_API_TOKEN }}