@@ -31,44 +31,39 @@ jobs:
31
31
# https://github.com/cmu-delphi/delphi-epidata/pull/1473
32
32
run : |
33
33
python -m pip install bump2version
34
- allowed_pattern="^(major|minor|patch|[0-9]+\.[0-9]+\.[0-9]+)$"
35
-
36
- if [[ ! ${{ github.event.inputs.versionName }} =~ $allowed_pattern ]]; then
37
- echo "\nInvalid version name: ${{ github.event.inputs.versionName }}"
38
- exit 1
39
- fi
40
-
41
34
if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
42
35
# use given version number
43
36
NEXT_TAG="${{ github.event.inputs.versionName }}"
44
- else
37
+ elif [[ ${{ github.event.inputs.versionName }} =~ ^(major|minor|patch)$ ]]; then
45
38
# calculate new version number based on given tag
46
39
NEXT_TAG=$(bump2version --dry-run --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",,)
40
+ else
41
+ echo "\nInvalid version name: ${{ github.event.inputs.versionName }}"
42
+ exit 1
47
43
fi
48
44
# apply given or calculated version number
49
45
bump2version --new-version $NEXT_TAG _ignored_arg_
50
46
# save version number for later
51
47
echo "next_tag=$NEXT_TAG" >> $GITHUB_OUTPUT
52
- - name : Get main branch SHA
53
- id : base-sha
54
- run : echo "sha=$(git rev-parse origin/main)" >> $GITHUB_OUTPUT
55
48
- name : Get Python client file changes
56
49
id : changed-py
57
50
uses : dorny/paths-filter@v3
58
51
with :
59
- base : " ${{ steps.base-sha.outputs.sha }}"
52
+ base : " main"
53
+ ref : " dev"
60
54
filters : |
61
55
python_client_changed:
62
- - src/client/delphi_epidata.py
63
- - src/client/packaging/pypi/**
56
+ - src/client/delphi_epidata.py
57
+ - src/client/packaging/pypi/**
64
58
- name : Bump Python versions if client files changed
65
59
if : steps.changed-py.outputs.python_client_changed == 'true'
66
60
# _ignored_arg_ below is required because of tool quirk
67
61
# https://github.com/c4urself/bump2version/issues/22
68
62
run : |
69
63
cd src/client/packaging/pypi
64
+ # this is using the new literal version number (steps.version.outputs.next_tag) output from the bump2version step above, not the workflow input (github.event.inputs.versionName) which can be relative
70
65
bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} _ignored_arg_
71
- - name : Create pull request into prod
66
+ - name : Create pull request into main
72
67
uses : peter-evans/create-pull-request@v3
73
68
with :
74
69
branch : release/delphi-epidata-${{ steps.version.outputs.next_tag }}
0 commit comments