]> Repositories - Adafruit_Blinka-hackapet.git/blob - .github/workflows/release.yml
Revert back to using setup.py to fix install problems
[Adafruit_Blinka-hackapet.git] / .github / workflows / release.yml
1 # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2 #
3 # SPDX-License-Identifier: Unlicense
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@v3
13     - name: Check For setup.py
14       id: need-pypi
15       run: |
16         echo "setup-py=$( find . -wholename './setup.py' )" >> $GITHUB_OUTPUT
17     - name: Set up Python
18       if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
19       uses: actions/setup-python@v4
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 --upgrade build 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         for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
34             sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file;
35         done;
36         python -m build
37         twine upload dist/*