-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (48 loc) · 1.38 KB
/
update-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Update Version
on:
push:
branches: [ main ]
jobs:
update_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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