publish.yml 992 B

1234567891011121314151617181920212223242526272829303132333435
  1. # This workflow 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: Upload Python Package
  4. on:
  5. release:
  6. types: [created]
  7. jobs:
  8. deploy:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v2
  12. - name: Set up Python
  13. uses: actions/setup-python@v2
  14. with:
  15. python-version: '3.9'
  16. - name: Install dependencies
  17. run: |
  18. python -m pip install --upgrade pip
  19. pip install setuptools wheel twine
  20. - name: Build and publish
  21. env:
  22. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  23. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  24. run: |
  25. python setup.py sdist bdist_wheel
  26. twine upload dist/*
  27. - name: Upload coverage report
  28. uses: actions/upload-artifact@v2
  29. with:
  30. name: dist
  31. path: dist/