Skip to content

Commit 0d02153

Browse files
committed
Fix container jobs: use relative paths for artifact upload
Container jobs using `container:` directive have a "Split-Brain" issue where shell steps run inside the container (/__w/...) but Node.js actions like upload-artifact run on the host (/home/runner/...). - Change wheels-docker.yml to use relative path: wheelhouse/ - Change wheels-arm64.yml to use relative path for consistency - Add detailed comments explaining the host/container path mismatch - Remove the now-unnecessary container-workspace step Relative paths work in both contexts because GitHub guarantees the CWD is set to workspace root for both container and host. Note: This work was completed with AI assistance (Claude Code).
1 parent 17d863c commit 0d02153

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

.github/workflows/wheels-arm64.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,20 @@ jobs:
420420
echo "==> Wheel inventory:"
421421
find wheelhouse/ -name "*.whl" -exec basename {} \; 2>/dev/null | sort || echo "No wheels found"
422422
423+
# ============================================================================
424+
# Note on paths: This workflow uses Docker containers but NOT the GitHub
425+
# Actions `container:` directive. Instead, it runs `docker run` commands
426+
# from the host, mounting the workspace. The upload step runs directly on
427+
# the host (not inside Docker), so ${{ github.workspace }} works correctly.
428+
#
429+
# However, for consistency and safety, we use a relative path here as well.
430+
# This ensures the workflow remains robust if the architecture changes.
431+
# ============================================================================
423432
- name: Upload wheels and build metadata with cryptographic verification
424433
uses: wamp-proto/wamp-cicd/actions/upload-artifact-verified@main
425434
with:
426435
name: artifacts-arm64-${{ matrix.target.name }}
427-
path: ${{ github.workspace }}/wheelhouse/
436+
path: wheelhouse/
428437
retention-days: 30
429438

430439
# GitHub Releases, PyPI, and RTD publishing are now handled by the centralized 'release' workflow

.github/workflows/wheels-docker.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -475,23 +475,35 @@ jobs:
475475
echo "==> Wheel inventory:"
476476
find wheelhouse/ -name "*.whl" -exec basename {} \; 2>/dev/null | sort || echo "No wheels found"
477477
478-
# For container jobs, github.workspace contains the HOST path (e.g., /home/runner/work/...)
479-
# but the container mounts the workspace at a different path (e.g., /__w/...).
480-
# We must capture the actual container path at runtime.
481-
- name: Get container workspace path
482-
id: container-workspace
483-
run: |
484-
echo "==> Container workspace detection:"
485-
echo "pwd: $(pwd)"
486-
echo "GITHUB_WORKSPACE env: ${GITHUB_WORKSPACE:-not set}"
487-
echo "path=$(pwd)" >> $GITHUB_OUTPUT
488-
489-
- name:
490-
Upload wheels, source dist and build metadata with cryptographic verification
478+
# ============================================================================
479+
# IMPORTANT: Container Jobs Require RELATIVE Paths for Artifact Upload
480+
# ============================================================================
481+
#
482+
# This job uses `container: <image>` which creates a "Split-Brain" scenario:
483+
#
484+
# 1. Shell steps (run:) execute INSIDE the container where:
485+
# - Working directory = /__w/repo/repo (container mount point)
486+
# - $GITHUB_WORKSPACE = /__w/repo/repo (correct for container)
487+
#
488+
# 2. Node.js actions (uses:) like upload-artifact run on the HOST where:
489+
# - Working directory = /home/runner/work/repo/repo
490+
# - ${{ github.workspace }} = /home/runner/work/repo/repo (host path)
491+
#
492+
# If we pass a container-resolved path (/__w/...) to upload-artifact,
493+
# the action will fail because that path doesn't exist on the host.
494+
#
495+
# The ONLY path that works in BOTH contexts is a RELATIVE PATH.
496+
# GitHub guarantees the CWD is the workspace root for both environments,
497+
# so "wheelhouse/" resolves correctly in both container and host.
498+
#
499+
# For non-container jobs, we use absolute paths: ${{ github.workspace }}/...
500+
# For container jobs, we MUST use relative paths: wheelhouse/
501+
# ============================================================================
502+
- name: Upload wheels, source dist and build metadata with cryptographic verification
491503
uses: wamp-proto/wamp-cicd/actions/upload-artifact-verified@main
492504
with:
493505
name: artifacts-${{ matrix.target.name }}
494-
path: ${{ steps.container-workspace.outputs.path }}/wheelhouse/
506+
path: wheelhouse/
495507
retention-days: 30
496508

497509
# GitHub Releases, PyPI, and RTD publishing are now handled by the centralized 'release' workflow

0 commit comments

Comments
 (0)