deploy.yaml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Publish cloudbridge to PyPI
  2. on:
  3. release:
  4. types: [published]
  5. push:
  6. tags:
  7. - '*'
  8. jobs:
  9. build-n-publish:
  10. name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@master
  14. - name: Set up Python 3.10.12
  15. uses: actions/setup-python@v1
  16. with:
  17. python-version: 3.10.12
  18. - name: Install dependencies
  19. run: |
  20. python3 -m pip install --upgrade pip setuptools
  21. python3 -m pip install --upgrade twine wheel
  22. - name: Create and check packages
  23. run: |
  24. python3 setup.py sdist bdist_wheel
  25. twine check dist/*
  26. ls -l dist
  27. - name: Publish distribution 📦 to Test PyPI
  28. uses: pypa/gh-action-pypi-publish@master
  29. with:
  30. password: ${{ secrets.TEST_PYPI_API_TOKEN }}
  31. repository_url: https://test.pypi.org/legacy/
  32. skip_existing: true
  33. - name: Publish distribution 📦 to PyPI
  34. if: github.event_name == 'release'
  35. uses: pypa/gh-action-pypi-publish@master
  36. with:
  37. password: ${{ secrets.PYPI_API_TOKEN }}