Skip to content

Decouple client release from Delphi release #1465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 25, 2024
4 changes: 0 additions & 4 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ tag = False

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

[bumpversion:file:src/client/delphi_epidata.py]

[bumpversion:file:src/client/packaging/npm/package.json]

[bumpversion:file:src/client/packaging/pypi/setup.py]

[bumpversion:file:dev/local/setup.cfg]
16 changes: 16 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ jobs:
python -m pip install bump2version
echo -n "::set-output name=next_tag::"
bump2version --list ${{ github.event.inputs.versionName }} | grep new_version | sed -r s,"^.*=",,
- name: Get main branch SHA
id: base-sha
run: echo "sha=$(git rev-parse origin/main)" >> $GITHUB_OUTPUT
- name: Get Python client file changes
id: changed-py
uses: tj-actions/changed-files@v44
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use dorny/paths-filter here (and also in release-helper.yml) to match the usage in the covidcast-indicators repo? fewer dependencies and reinvented wheels make for easier support and maintenance.
https://github.com/cmu-delphi/covidcast-indicators/blob/a6ea00355d79a47cc09db8090f6e5121c718de0f/.github/workflows/create-release.yml#L32-L40
https://github.com/cmu-delphi/covidcast-indicators/blob/a6ea00355d79a47cc09db8090f6e5121c718de0f/.github/workflows/publish-release.yml#L31-L41

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can give it a go, it should support the same features as changed-files.

with:
base_sha: "${{ steps.base-sha.outputs.sha }}"
files: |
src/client/delphi_epidata.py
src/client/packaging/pypi/**
- name: Bump Python versions if client files changed
if: steps.changed-py.outputs.any_changed == 'true'
run: |
cd src/client/packaging/pypi
bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} ignore_part
- name: Create pull request into prod
uses: peter-evans/create-pull-request@v3
with:
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/release-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ jobs:
if: github.repository_owner != 'cmu-delphi'
run: exit 1

client_changed:
needs: correct_repository
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get Python client file changes
id: changed-py
uses: tj-actions/changed-files@v44
with:
files: |
src/client/delphi_epidata.py
src/client/packaging/pypi/**
outputs:
any_changed: ${{ steps.changed-py.outputs.any_changed }}

create_release:
needs: correct_repository
runs-on: ubuntu-latest
Expand Down Expand Up @@ -45,7 +63,8 @@ jobs:
tag_name: ${{ steps.create_release.outputs.tag_name }}

release_python_client:
needs: create_release
needs: [client_changed, create_release]
if: needs.client_changed.outputs.any_changed == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
8 changes: 8 additions & 0 deletions src/client/packaging/pypi/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[bumpversion]
current_version = 4.1.23
commit = False
tag = False

[bumpversion:file:../../delphi_epidata.py]

[bumpversion:file:setup.py]
Loading