You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
944 B

  1. name: Release Actions
  2. on:
  3. release:
  4. types: [published]
  5. jobs:
  6. upload-pypi:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - uses: actions/checkout@v1
  10. - name: Check For setup.py
  11. id: need-pypi
  12. run: |
  13. echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
  14. - name: Set up Python
  15. if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
  16. uses: actions/setup-python@v1
  17. with:
  18. python-version: '3.x'
  19. - name: Install dependencies
  20. if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
  21. run: |
  22. python -m pip install --upgrade pip
  23. pip install setuptools wheel twine
  24. - name: Build and publish
  25. if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
  26. env:
  27. TWINE_USERNAME: ${{ secrets.pypi_username }}
  28. TWINE_PASSWORD: ${{ secrets.pypi_password }}
  29. run: |
  30. python setup.py sdist
  31. twine upload dist/*