Skip to content

Commit a7f19b8

Browse files
committed
ci: 🎡 refactor wheel build versioning
1 parent 451d373 commit a7f19b8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/wheels.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,15 @@ jobs:
242242
run: |
243243
pdm install -G build -G release --no-self --no-lock -v
244244
245-
- name: Increment version
245+
- name: Increment version if releasing
246246
id: semantic-version
247247
run: |
248-
pdm run semantic-release --noop -v version --patch --no-commit
249-
version=$(pdm run semantic-release version --patch --no-commit 2>/dev/null)
250-
echo "version=$version" >> "$GITHUB_OUTPUT"
248+
current_version=$(grep '^version =' pyproject.toml | head -1 | cut -d '"' -f 2)
249+
next_version=$(pdm run semantic-release version --patch --print 2>/dev/null)
250+
echo "version=$next_version" >> "$GITHUB_OUTPUT"
251+
if [ $next_version != $current_version ]; then
252+
pdm run semantic-release version --patch --skip-build --no-commit --no-tag --no-vcs-release --no-changelog
253+
fi
251254
252255
- name: Setup macOS environment
253256
if: contains(matrix.os, 'macos')

pdm.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)