1 # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2 # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries
4 # SPDX-License-Identifier: MIT
14 runs-on: ubuntu-latest
16 - uses: actions/checkout@v3
17 - name: Check For pyproject.toml
20 echo "pyproject-toml=$( find . -wholename './pyproject.toml' )" >> $GITHUB_OUTPUT
22 if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
23 uses: actions/setup-python@v4
26 - name: Install dependencies
27 if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
29 python -m pip install --upgrade pip
30 pip install --upgrade build twine
31 - name: Build and publish
32 if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
34 TWINE_USERNAME: ${{ secrets.pypi_username }}
35 TWINE_PASSWORD: ${{ secrets.pypi_password }}
37 for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
38 sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file;