Skip to content

Commit ba00d40

Browse files
committed
Updates
1 parent 7ec1433 commit ba00d40

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

.github/workflows/create-release.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,39 @@ jobs:
3131
# https://github.com/cmu-delphi/delphi-epidata/pull/1473
3232
run: |
3333
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-
4134
if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
4235
# use given version number
4336
NEXT_TAG="${{ github.event.inputs.versionName }}"
44-
else
37+
elif [[ ${{ github.event.inputs.versionName }} =~ ^(major|minor|patch)$ ]]; then
4538
# calculate new version number based on given tag
4639
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
4743
fi
4844
# apply given or calculated version number
4945
bump2version --new-version $NEXT_TAG _ignored_arg_
5046
# save version number for later
5147
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
5548
- name: Get Python client file changes
5649
id: changed-py
5750
uses: dorny/paths-filter@v3
5851
with:
59-
base: "${{ steps.base-sha.outputs.sha }}"
52+
base: "main"
53+
ref: "dev"
6054
filters: |
6155
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/**
6458
- name: Bump Python versions if client files changed
6559
if: steps.changed-py.outputs.python_client_changed == 'true'
6660
# _ignored_arg_ below is required because of tool quirk
6761
# https://github.com/c4urself/bump2version/issues/22
6862
run: |
6963
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
7065
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
7267
uses: peter-evans/create-pull-request@v3
7368
with:
7469
branch: release/delphi-epidata-${{ steps.version.outputs.next_tag }}

.github/workflows/release-helper.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ jobs:
2525
id: changed-py
2626
uses: dorny/paths-filter@v3
2727
with:
28+
# when base and ref are the same, changes are detected against the most recent commit before the push.
29+
# see https://github.com/dorny/paths-filter#usage for details.
30+
base: 'main'
31+
ref: 'main'
2832
filters: |
2933
python_client_changed:
30-
- src/client/delphi_epidata.py
31-
- src/client/packaging/pypi/**
34+
- src/client/delphi_epidata.py
35+
- src/client/packaging/pypi/**
3236
outputs:
3337
python_client_changed: ${{ steps.changed-py.outputs.python_client_changed }}
3438

0 commit comments

Comments
 (0)