cd.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
  2. on:
  3. release:
  4. types: [published]
  5. jobs:
  6. build-n-publish:
  7. name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
  8. runs-on: ubuntu-latest
  9. permissions:
  10. id-token: write
  11. steps:
  12. - uses: actions/checkout@v2
  13. - name: Set up Python
  14. uses: actions/setup-python@v2
  15. with:
  16. python-version: '3.11'
  17. - name: Install Poetry
  18. run: |
  19. curl -sSL https://install.python-poetry.org | python3 -
  20. echo "$HOME/.local/bin" >> $GITHUB_PATH
  21. - name: Install dependencies
  22. run: |
  23. cd embedchain
  24. poetry install
  25. - name: Build a binary wheel and a source tarball
  26. run: |
  27. cd embedchain
  28. poetry build
  29. - name: Publish distribution 📦 to Test PyPI
  30. uses: pypa/gh-action-pypi-publish@release/v1
  31. with:
  32. repository_url: https://test.pypi.org/legacy/
  33. packages_dir: embedchain/dist/
  34. - name: Publish distribution 📦 to PyPI
  35. if: startsWith(github.ref, 'refs/tags')
  36. uses: pypa/gh-action-pypi-publish@release/v1
  37. with:
  38. packages_dir: embedchain/dist/