44 workflow_dispatch :
55 inputs :
66 versionName :
7- description : ' Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease )'
7+ description : ' Semantic Version Number (i.e., 5.5.0 or patch, minor, major)'
88 required : true
99 default : patch
1010
@@ -27,10 +27,23 @@ jobs:
2727 python-version : 3.8
2828 - name : Change version number
2929 id : version
30+ # See this issue for explanation and testing:
31+ # https://github.com/cmu-delphi/delphi-epidata/pull/1473
3032 run : |
31- python -m pip install bump2version
32- echo -n "::set-output name=next_tag::"
33- bump2version --list ${{ github.event.inputs.versionName }} | grep new_version | sed -r s,"^.*=",,
33+ python -m pip install bump-my-version
34+ echo -n "next_tag=" >> $GITHUB_OUTPUT
35+ allowed_pattern="^(major|minor|patch|[0-9]+\.[0-9]+\.[0-9]+)$"
36+
37+ if [[ ! ${{ github.event.inputs.versionName }} =~ $allowed_pattern ]]; then
38+ echo "\nInvalid version name: ${{ github.event.inputs.versionName }}"
39+ exit 1
40+ fi
41+
42+ if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
43+ echo "${{ github.event.inputs.versionName }}"
44+ else
45+ echo $(bump-my-version show-bump | grep ${{ github.event.inputs.versionName }} | sed -r s,"^.*─ ",,)
46+ fi
3447 - name : Get main branch SHA
3548 id : base-sha
3649 run : echo "sha=$(git rev-parse origin/main)" >> $GITHUB_OUTPUT
4659 if : steps.changed-py.outputs.any_changed == 'true'
4760 run : |
4861 cd src/client/packaging/pypi
49- bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} ignore_part
62+ bump-my-version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }}
5063 - name : Create pull request into prod
5164 uses : peter-evans/create-pull-request@v3
5265 with :
0 commit comments