Skip to content

Commit e160156

Browse files
authored
fix: skip update_versions.py on release builds to prevent dirty state
2 parents 3374f9d + 6a87a6f commit e160156

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/publish_pypi.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ jobs:
4646
git describe --tags --long
4747
shell: bash
4848

49-
- name: Update version files
49+
- name: Verify version detection
5050
run: |
5151
python -m pip install setuptools-scm
52-
# Extract version from tag name if this is a release
52+
# For release tags, version files are already updated by release-please
53+
# Don't run update_versions.py to avoid dirtying the working directory
5354
if [ -n "$GITHUB_REF_NAME" ] && [[ "$GITHUB_REF_NAME" == v* ]]; then
5455
VERSION="${GITHUB_REF_NAME#v}"
55-
echo "Using release version: $VERSION"
56-
python scripts/update_versions.py --version "$VERSION"
56+
echo "Release build - version files already updated to: $VERSION"
57+
echo "Skipping update_versions.py to keep working directory clean"
5758
else
59+
echo "Development build - updating version files"
5860
python scripts/update_versions.py
5961
fi
6062
# Verify setuptools-scm version detection
@@ -140,15 +142,17 @@ jobs:
140142
git describe --tags --long
141143
shell: bash
142144

143-
- name: Update version files
145+
- name: Verify version detection
144146
run: |
145147
python -m pip install setuptools-scm
146-
# Extract version from tag name if this is a release
148+
# For release tags, version files are already updated by release-please
149+
# Don't run update_versions.py to avoid dirtying the working directory
147150
if [ -n "$GITHUB_REF_NAME" ] && [[ "$GITHUB_REF_NAME" == v* ]]; then
148151
VERSION="${GITHUB_REF_NAME#v}"
149-
echo "Using release version: $VERSION"
150-
python scripts/update_versions.py --version "$VERSION"
152+
echo "Release build - version files already updated to: $VERSION"
153+
echo "Skipping update_versions.py to keep working directory clean"
151154
else
155+
echo "Development build - updating version files"
152156
python scripts/update_versions.py
153157
fi
154158
# Verify setuptools-scm version detection

0 commit comments

Comments
 (0)