Skip to content

Merge pull request #99 from aphedges/fix-update_version-job #21

Merge pull request #99 from aphedges/fix-update_version-job

Merge pull request #99 from aphedges/fix-update_version-job #21

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