Merge pull request #100 from aphedges/fix-invalid-escapes #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Version | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| update_version: | |
| runs-on: ubuntu-22.04 # Needed for Python 3.7 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/[email protected] | |
| id: filter | |
| with: | |
| filters: | | |
| src: | |
| - 'src/**/*.*' | |
| pyproject: | |
| - 'pyproject.toml' | |
| setup: | |
| - 'setup.cfg' | |
| - uses: bpshaver/[email protected] | |
| if: | | |
| ${{ steps.filter.outputs.src == 'true' || | |
| steps.filter.outputs.pyproject == 'true' || | |
| steps.filter.outputs.setup == 'true' }} | |
| with: | |
| file: setup.cfg | |
| # We could always bump major, minor, or patch, or we could pass a value to | |
| # this argument ourselves if we have some better way of inferring which | |
| # version to bump | |
| version: infer | |
| - name: make_tag | |
| if: | | |
| ${{ steps.filter.outputs.src == 'true' || | |
| steps.filter.outputs.pyproject == 'true' || | |
| steps.filter.outputs.setup == 'true' }} | |
| run: | | |
| version=$( | |
| awk '/^version/ { print $3 }' setup.cfg | |
| ) | |
| patch=$( | |
| echo $version | | |
| awk 'BEGIN { FS = "." }; { print $3 }' | |
| ) | |
| if [ $patch == 0 ] | |
| then | |
| git tag v$version | |
| git push --tags | |
| fi | |