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 : dorny/paths-filter@v3
27+ 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'
32+ filters : |
33+ python_client_changed:
34+ - src/client/delphi_epidata.py
35+ - src/client/packaging/pypi/**
36+ outputs :
37+ python_client_changed : ${{ steps.changed-py.outputs.python_client_changed }}
38+
1639 create_release :
1740 needs : correct_repository
1841 runs-on : ubuntu-latest
2952 id : extract_version
3053 run : |
3154 python -m pip install bump2version
32- echo -n "::set-output name=version::"
33- bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,
55+ VERSION=$(bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,)
56+ echo "version=$VERSION" >> $GITHUB_OUTPUT
3457 - name : Create Release
3558 id : create_release
3659 uses : release-drafter/release-drafter@v5
4568 tag_name : ${{ steps.create_release.outputs.tag_name }}
4669
4770 release_python_client :
48- needs : create_release
71+ needs : [client_changed, create_release]
72+ if : needs.client_changed.outputs.python_client_changed == 'true'
4973 runs-on : ubuntu-latest
5074 steps :
5175 - name : Check out code
@@ -57,15 +81,15 @@ jobs:
5781 - name : Install build dependencies
5882 run : |
5983 python -m pip install --upgrade pip
60- pip install wheel twine
84+ pip install build wheel twine
6185 - name : Prepare package
6286 run : |
6387 cp src/client/*.py src/client/packaging/pypi/delphi_epidata/
6488 - name : Create release
6589 working-directory : src/client/packaging/pypi
6690 run : |
67- python setup.py sdist bdist_wheel
68- - uses : actions/upload-artifact@v2
91+ python -m build -- sdist --wheel
92+ - uses : actions/upload-artifact@v4
6993 with :
7094 name : delphi_epidata_py
7195 path : src/client/packaging/pypi/dist/*.tar.gz
80104 with :
81105 user : __token__
82106 password : ${{ secrets.DELPHI_PYPI_PROD_TOKEN }}
83- packages_dir : src/client/packaging/pypi/dist/
84- skip_existing : true
107+ packages-dir : src/client/packaging/pypi/dist/
108+ skip-existing : true
85109 # repository_url: https://test.pypi.org/legacy/
86110
87111 release_js_client :
95119 uses : actions/checkout@v2
96120 - uses : actions/setup-node@v2
97121 with :
98- node-version : ' 16.x'
122+ node-version : " 16.x"
99123 - name : Cache Node.js modules
100124 uses : actions/cache@v2
101125 with :
@@ -108,7 +132,7 @@ jobs:
108132 - run : npm pack
109133 - name : Rename to a different name
110134 run : for f in *.tgz; do mv "$f" "$(echo "$f" | sed s/delphi_epidata-/delphi_epidata_js-/)"; done
111- - uses : actions/upload-artifact@v2
135+ - uses : actions/upload-artifact@v4
112136 with :
113137 name : delphi_epidata_js
114138 path : src/client/packaging/npm/*.tgz
0 commit comments