Skip to content

Commit aa31d58

Browse files
committed
Introduce validating version field against git tag
1 parent 08fc862 commit aa31d58

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎.github/workflows/cd.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ jobs:
2525
python-version: 3.13
2626
deps-group: release
2727
- name: Set pre-release version
28-
id: set-version
2928
if: startsWith(github.ref, 'refs/tags/') != true
3029
run: |
3130
VERSION_BASE="$(uv version --short)"
3231
RUN_NUMBER="${{ github.run_number }}"
33-
uv version --frozen "${VERSION_BASE}.dev${RUN_NUMBER}"
32+
uv version "${VERSION_BASE}.dev${RUN_NUMBER}"
33+
- name: Set release version
34+
if: startsWith(github.ref, 'refs/tags/') == true
35+
run: |
36+
VERSION_TAG="${{ github.event.release.tag_name }}"
37+
[[ $VERSION_TAG != $(uv version --short) ]] && {
38+
printf "Git tag should be identical to version field in pyproject.toml"
39+
exit 1
40+
}
41+
uv version "$(VERSION_TAG)"
3442
- name: Get current version
3543
id: get-version
3644
run: echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)