python-publish.yml 899 B

12345678910111213141516171819202122232425262728293031323334
  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. branches: [ master ]
  7. jobs:
  8. deploy:
  9. runs-on: ubuntu-latest
  10. allow_failure: true
  11. only:
  12. - tags
  13. steps:
  14. - uses: actions/checkout@v2
  15. - name: Set up Python
  16. uses: actions/setup-python@v2
  17. with:
  18. python-version: '3.x'
  19. - name: Install dependencies
  20. run: |
  21. python -m pip install --upgrade pip
  22. pip install setuptools wheel twine
  23. - name: Build and publish
  24. env:
  25. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  26. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  27. run: |
  28. python setup.py sdist bdist_wheel
  29. twine upload dist/*