Skip to content

Commit 57224a4

Browse files
authored
Fix/ci clean workspace (#170)
* fix(ci): clean workspace before build to avoid dirty version * chore: add debug info to CI * fix(ci): remove duplicate run key in build workflow * fix(ci): ignore uv.lock changes and use frozen run to fix dirty version * fix(ci): explicitly remove generated version file and egg-info
1 parent ead9817 commit 57224a4

File tree

1 file changed

+66
-3
lines changed

1 file changed

+66
-3
lines changed

.github/workflows/_build.yml

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,29 @@ jobs:
7474
- name: Install build dependencies
7575
run: uv pip install build setuptools_scm
7676

77+
- name: Clean workspace (force ignore dirty)
78+
shell: bash
79+
run: |
80+
git reset --hard HEAD
81+
git clean -fd
82+
rm -rf openviking/_version.py openviking.egg-info
83+
# Ignore uv.lock changes to avoid dirty state in setuptools_scm
84+
git update-index --assume-unchanged uv.lock || true
85+
86+
- name: Debug Git and SCM
87+
shell: bash
88+
run: |
89+
echo "=== Git Describe ==="
90+
git describe --tags --long --dirty --always
91+
echo "=== Setuptools SCM Version ==="
92+
uv run --frozen python -m setuptools_scm
93+
echo "=== Git Status (Ignored included) ==="
94+
git status --ignored
95+
echo "=== Check openviking/_version.py ==="
96+
if [ -f openviking/_version.py ]; then cat openviking/_version.py; else echo "Not found"; fi
97+
7798
- name: Build sdist
78-
run: uv run python -m build --sdist
99+
run: uv run --frozen python -m build --sdist
79100

80101
- name: Store the distribution packages
81102
uses: actions/upload-artifact@v6
@@ -184,8 +205,29 @@ jobs:
184205
- name: Install build dependencies
185206
run: uv pip install setuptools setuptools_scm pybind11 cmake wheel build
186207

208+
- name: Clean workspace (force ignore dirty)
209+
shell: bash
210+
run: |
211+
git reset --hard HEAD
212+
git clean -fd
213+
rm -rf openviking/_version.py openviking.egg-info
214+
# Ignore uv.lock changes to avoid dirty state in setuptools_scm
215+
git update-index --assume-unchanged uv.lock || true
216+
217+
- name: Debug Git and SCM
218+
shell: bash
219+
run: |
220+
echo "=== Git Describe ==="
221+
git describe --tags --long --dirty --always
222+
echo "=== Setuptools SCM Version ==="
223+
uv run --frozen python -m setuptools_scm
224+
echo "=== Git Status (Ignored included) ==="
225+
git status --ignored
226+
echo "=== Check openviking/_version.py ==="
227+
if [ -f openviking/_version.py ]; then cat openviking/_version.py; else echo "Not found"; fi
228+
187229
- name: Build package (Wheel Only)
188-
run: uv run python -m build --wheel
230+
run: uv run --frozen python -m build --wheel
189231

190232
- name: Install patchelf (Linux)
191233
run: |
@@ -277,8 +319,29 @@ jobs:
277319
- name: Install build dependencies
278320
run: uv pip install setuptools setuptools_scm pybind11 cmake wheel build
279321

322+
- name: Clean workspace (force ignore dirty)
323+
shell: bash
324+
run: |
325+
git reset --hard HEAD
326+
git clean -fd
327+
rm -rf openviking/_version.py openviking.egg-info
328+
# Ignore uv.lock changes to avoid dirty state in setuptools_scm
329+
git update-index --assume-unchanged uv.lock || true
330+
331+
- name: Debug Git and SCM
332+
shell: bash
333+
run: |
334+
echo "=== Git Describe ==="
335+
git describe --tags --long --dirty --always
336+
echo "=== Setuptools SCM Version ==="
337+
uv run --frozen python -m setuptools_scm
338+
echo "=== Git Status (Ignored included) ==="
339+
git status --ignored
340+
echo "=== Check openviking/_version.py ==="
341+
if [ -f openviking/_version.py ]; then cat openviking/_version.py; else echo "Not found"; fi
342+
280343
- name: Build package (Wheel Only)
281-
run: uv run python -m build --wheel
344+
run: uv run --frozen python -m build --wheel
282345

283346
- name: Store the distribution packages
284347
uses: actions/upload-artifact@v6

0 commit comments

Comments
 (0)