Skip to content

Commit 078a422

Browse files
nikolay-eclaude
andcommitted
fix: resolve CD workflow version handling issues
- Add git remote configuration after bundle restore - Install package in editable mode for PyInstaller - Add explicit module paths for PyInstaller build - Add comprehensive debugging output for troubleshooting - Verify version consistency across all workflow jobs - Fix cross-platform executable verification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 95cbfc0 commit 078a422

1 file changed

Lines changed: 55 additions & 3 deletions

File tree

.github/workflows/cd.yml

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ jobs:
129129
cd repo
130130
git checkout ${{ needs.prepare-version.outputs.tag_name }}
131131
132+
# Debug: verify we're in the right state
133+
echo "Current directory: $(pwd)"
134+
echo "Current tag: $(git describe --tags --exact-match 2>/dev/null || echo 'no tag')"
135+
echo "Current commit: $(git rev-parse HEAD)"
136+
echo "Version file content:"
137+
cat src/treemapper/version.py || echo "ERROR: version.py not found!"
138+
echo "Directory structure:"
139+
ls -la src/treemapper/ || echo "ERROR: src/treemapper not found!"
140+
132141
- name: Set up Python
133142
uses: actions/setup-python@v6
134143
with:
@@ -147,12 +156,27 @@ jobs:
147156
working-directory: ./repo
148157
run: |
149158
python -m pip install --upgrade pip
150-
pip install .[dev]
159+
# Install in editable mode to ensure version.py changes are picked up
160+
pip install -e .[dev]
161+
162+
# Verify the installed version matches what we expect
163+
echo "Verifying installed version:"
164+
python -c "from treemapper.version import __version__; print(f'Version in module: {__version__}')"
165+
echo "Expected version: ${{ needs.prepare-version.outputs.version }}"
151166
152167
- name: Build with PyInstaller
153168
working-directory: ./repo
154169
run: |
155-
python -m PyInstaller --clean -y --dist ./dist/${{ matrix.asset_name }} treemapper.spec
170+
# Ensure PyInstaller can find the modules
171+
export PYTHONPATH="${PWD}/src:${PYTHONPATH}"
172+
echo "PYTHONPATH: $PYTHONPATH"
173+
174+
# Run PyInstaller with explicit paths
175+
python -m PyInstaller --clean -y --dist ./dist/${{ matrix.asset_name }} --paths ./src treemapper.spec
176+
177+
# Verify the built executable exists (cross-platform)
178+
echo "Checking for built executable in: ./dist/${{ matrix.asset_name }}/"
179+
ls -la "./dist/${{ matrix.asset_name }}/" || echo "ERROR: dist directory not found!"
156180
157181
- name: Determine architecture
158182
id: arch
@@ -211,6 +235,15 @@ jobs:
211235
cd repo
212236
git checkout ${{ needs.prepare-version.outputs.tag_name }}
213237
238+
# Debug: verify we're in the right state
239+
echo "Current directory: $(pwd)"
240+
echo "Current tag: $(git describe --tags --exact-match 2>/dev/null || echo 'no tag')"
241+
echo "Current commit: $(git rev-parse HEAD)"
242+
echo "Version file content:"
243+
cat src/treemapper/version.py || echo "ERROR: version.py not found!"
244+
echo "Directory structure:"
245+
ls -la src/treemapper/ || echo "ERROR: src/treemapper not found!"
246+
214247
- name: Set up Python
215248
uses: actions/setup-python@v6
216249
with:
@@ -222,9 +255,22 @@ jobs:
222255
python -m pip install --upgrade pip
223256
pip install build
224257
258+
# Verify version.py has the correct version
259+
echo "Version in version.py:"
260+
cat src/treemapper/version.py
261+
echo "Expected version: ${{ needs.prepare-version.outputs.version }}"
262+
225263
- name: Build sdist and wheel
226264
working-directory: ./repo
227-
run: python -m build
265+
run: |
266+
# Build the distribution packages
267+
python -m build
268+
269+
# Verify the built packages have correct version in filename
270+
echo "Built packages:"
271+
ls -la dist/
272+
echo "Looking for version ${{ needs.prepare-version.outputs.version }} in package names..."
273+
ls dist/*${{ needs.prepare-version.outputs.version }}* || echo "WARNING: No packages found with expected version!"
228274
229275
- name: Publish package distributions to PyPI
230276
uses: pypa/gh-action-pypi-publish@release/v1
@@ -255,6 +301,12 @@ jobs:
255301
echo "Current branch: $(git branch --show-current)"
256302
echo "Current commit: $(git rev-parse HEAD)"
257303
304+
# Set up remote to point to the actual GitHub repository
305+
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
306+
307+
# Verify remote is set up correctly
308+
git remote -v
309+
258310
- name: Push commit and tag to main
259311
working-directory: ./repo
260312
run: |

0 commit comments

Comments
 (0)