python-package.yml 873 B

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