Skip to content

Commit 4ed7181

Browse files
committed
fix(ci): use bump2version and validate
1 parent 1f50b0b commit 4ed7181

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/create-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jobs:
3030
# See this issue for explanation and testing:
3131
# https://github.com/cmu-delphi/delphi-epidata/pull/1473
3232
run: |
33-
python -m pip install bump-my-version
34-
echo -n "next_tag=" >> $GITHUB_OUTPUT
33+
python -m pip install bump2version
3534
allowed_pattern="^(major|minor|patch|[0-9]+\.[0-9]+\.[0-9]+)$"
3635
3736
if [[ ! ${{ github.event.inputs.versionName }} =~ $allowed_pattern ]]; then
@@ -40,10 +39,11 @@ jobs:
4039
fi
4140
4241
if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
43-
echo "${{ github.event.inputs.versionName }}"
42+
NEXT_TAG="${{ github.event.inputs.versionName }}"
4443
else
45-
echo $(bump-my-version show-bump | grep ${{ github.event.inputs.versionName }} | sed -r s,"^.*",,)
44+
NEXT_TAG=$(bump2version --dry-run --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",,)
4645
fi
46+
echo "next_tag=$NEXT_TAG" >> $GITHUB_OUTPUT
4747
- name: Get main branch SHA
4848
id: base-sha
4949
run: echo "sha=$(git rev-parse origin/main)" >> $GITHUB_OUTPUT
@@ -59,7 +59,7 @@ jobs:
5959
if: steps.changed-py.outputs.any_changed == 'true'
6060
run: |
6161
cd src/client/packaging/pypi
62-
bump-my-version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }}
62+
bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} _ignored_arg_
6363
- name: Create pull request into prod
6464
uses: peter-evans/create-pull-request@v3
6565
with:

.github/workflows/release-helper.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
id: extract_version
4848
run: |
4949
python -m pip install bump2version
50-
echo -n "::set-output name=version::"
51-
bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,
50+
VERSION=$(bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,)
51+
echo "version=$VERSION"
5252
- name: Create Release
5353
id: create_release
5454
uses: release-drafter/release-drafter@v5

0 commit comments

Comments
 (0)