Skip to content

Commit ea7d09a

Browse files
committed
fix(release): pin build version via SETUPTOOLS_SCM_PRETEND_VERSION
hatch-vcs detects dirty working tree (submodule state) and appends local version identifier, producing 0.4.1.dev0+g<hash>.d<date> instead of the clean tag version. Force the correct version from the tag name.
1 parent ca4e2ab commit ea7d09a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ jobs:
4545

4646
- name: Build wheel + sdist
4747
working-directory: ${{ matrix.package.path }}
48-
run: uv run python -m build
48+
run: |
49+
# Force hatch-vcs / setuptools_scm to use the tag version, not dirty-tree dev version
50+
export SETUPTOOLS_SCM_PRETEND_VERSION="${GITHUB_REF_NAME#v}"
51+
uv run python -m build
4952
5053
- name: Upload dist artifact
5154
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4

0 commit comments

Comments
 (0)