Skip to content

Commit 207f87b

Browse files
committed
fix: CI bump version
1 parent 95c42a3 commit 207f87b

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ jobs:
3737
3838
- name: Bump version
3939
run: |
40-
if git rev-parse "v$(bump2version --dry-run --list patch | grep new_version | sed -r s,"^.*=",,)" >/dev/null 2>&1; then
41-
echo "Tag already exists. Skipping version bump."
42-
else
43-
bump2version patch
44-
fi
40+
# Keep bumping until we find a version without an existing tag
41+
for i in {1..10}; do
42+
NEW_VERSION=$(bump2version --dry-run --list patch | grep new_version | sed -r 's/^.*=//')
43+
if git rev-parse "v${NEW_VERSION}" >/dev/null 2>&1; then
44+
echo "Tag v${NEW_VERSION} already exists, bumping past it..."
45+
bump2version patch --no-tag --no-commit --allow-dirty
46+
else
47+
echo "Bumping to v${NEW_VERSION}"
48+
bump2version patch
49+
break
50+
fi
51+
done
4552
4653
- name: Build package
4754
run: python setup.py sdist bdist_wheel

0 commit comments

Comments
 (0)