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