From d81e6aa4dc78b847bf2c539d0d1fcbecdcc4cfbc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 15 Oct 2022 13:41:41 -0500 Subject: [PATCH] fix build process .. and use a simpler(?) way to invoke sed I don't know why this apparently only started recently, but circuitpython-build-tools creates build_deps/circuitpython with a directory 'nvm.toml' inside. The existing sed command would attempt to run on this directory. `find pattern... -exec command... +` takes the matching items and puts them on the command... commandline, without any concerns about whitespace or quoting. `for $(find...)` has several concerns about whitespace and quoting. It also adds "-type f" to restrict the match to only files, not directories. --- .github/workflows/build.yml | 4 +--- .github/workflows/release.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad339c3..00ab34d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,8 +70,6 @@ jobs: if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') run: | pip install --upgrade build twine - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; - done; + find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/1.2.3/" {} + python -m build twine check dist/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe458e2..9e18ad7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,8 +81,6 @@ jobs: TWINE_USERNAME: ${{ secrets.pypi_username }} TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; - done; + find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" {} + python -m build twine upload dist/*