Skip to content

Commit 2a4562f

Browse files
committed
Fix issue to versioning
1 parent 92e8edf commit 2a4562f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
1818
with:
19+
# Check out the tag that triggered the workflow so hatch-vcs sees exact tag
20+
ref: ${{ github.ref }}
1921
# Required for hatch-vcs to detect version from tags
2022
fetch-depth: 0
2123

@@ -45,6 +47,11 @@ jobs:
4547
- name: Run tests
4648
run: uv run pytest
4749

50+
- name: Verify we're on the tag (so hatch-vcs uses tag version)
51+
run: |
52+
git describe --exact-match HEAD || (echo "::error::HEAD is not exactly on tag ${{ github.ref_name }}"; exit 1)
53+
echo "Building version from tag: ${{ github.ref_name }}"
54+
4855
- name: Clean previous builds
4956
run: git clean -xfd dist build *.egg-info || true
5057

0 commit comments

Comments
 (0)