python-publish.yml 954 B

123456789101112131415161718192021222324252627282930313233
  1. # This workflows will upload a Python Package using Twine when a release is created
  2. # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
  3. name: pypi
  4. on:
  5. push:
  6. # Sequence of patterns matched against refs/tags
  7. tags:
  8. - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
  9. jobs:
  10. deploy:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Set up Python
  15. uses: actions/setup-python@v2
  16. with:
  17. python-version: '3.8'
  18. - name: Install dependencies
  19. run: |
  20. python -m pip install --upgrade pip
  21. pip install setuptools wheel twine
  22. - name: Build and publish
  23. env:
  24. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  25. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  26. run: |
  27. python setup.py sdist bdist_wheel
  28. twine upload dist/*