Skip to content

Commit 9122bc0

Browse files
committed
Decouple client release from Delphi release
1 parent c1551af commit 9122bc0

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ tag = False
99

1010
[bumpversion:file:src/client/delphi_epidata.R]
1111

12-
[bumpversion:file:src/client/delphi_epidata.py]
13-
1412
[bumpversion:file:src/client/packaging/npm/package.json]
1513

16-
[bumpversion:file:src/client/packaging/pypi/setup.py]
17-
1814
[bumpversion:file:dev/local/setup.cfg]

.github/workflows/create-release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ jobs:
3131
python -m pip install bump2version
3232
echo -n "::set-output name=next_tag::"
3333
bump2version --list ${{ github.event.inputs.versionName }} | grep new_version | sed -r s,"^.*=",,
34+
- name: Get main branch SHA
35+
id: base-sha
36+
run: echo "sha=$(git rev-parse origin/main)" >> $GITHUB_OUTPUT
37+
- name: Get Python client file changes
38+
id: changed-py
39+
uses: tj-actions/changed-files@v44
40+
with:
41+
base_sha: "${{ steps.base-sha.outputs.sha }}"
42+
files: |
43+
src/client/delphi_epidata.py
44+
src/client/packaging/pypi/**
45+
- name: Bump Python versions if client files changed
46+
if: steps.changed-py.outputs.any_changed == 'true'
47+
run: |
48+
cd src/client/packaging/pypi
49+
bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} ignore_part
3450
- name: Create pull request into prod
3551
uses: peter-evans/create-pull-request@v3
3652
with:

.github/workflows/release-helper.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ jobs:
1313
if: github.repository_owner != 'cmu-delphi'
1414
run: exit 1
1515

16+
client_changed:
17+
needs: correct_repository
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 2
24+
- name: Get Python client file changes
25+
id: changed-py
26+
uses: tj-actions/changed-files@v44
27+
with:
28+
files: |
29+
src/client/delphi_epidata.py
30+
src/client/packaging/pypi/**
31+
outputs:
32+
any_changed: ${{ steps.changed-py.outputs.any_changed }}
33+
1634
create_release:
1735
needs: correct_repository
1836
runs-on: ubuntu-latest
@@ -45,7 +63,8 @@ jobs:
4563
tag_name: ${{ steps.create_release.outputs.tag_name }}
4664

4765
release_python_client:
48-
needs: create_release
66+
needs: [client_changed, create_release]
67+
if: needs.client_changed.outputs.any_changed == 'true'
4968
runs-on: ubuntu-latest
5069
steps:
5170
- name: Check out code
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[bumpversion]
2+
current_version = 4.1.23
3+
commit = False
4+
tag = False
5+
6+
[bumpversion:file:../../delphi_epidata.py]
7+
8+
[bumpversion:file:setup.py]

0 commit comments

Comments
 (0)