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.

37 lines
1.0 KiB

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