Skip to content

Commit

Permalink
fix build process
Browse files Browse the repository at this point in the history
.. 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.
  • Loading branch information
jepler committed Oct 15, 2022
1 parent c98cff8 commit d81e6aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

0 comments on commit d81e6aa

Please sign in to comment.