Skip to content

Commit 9fcd74f

Browse files
cpcloudcursoragent
andcommitted
Inline publish artifact download to avoid repo checkout drift
Using direct gh artifact download in publish jobs keeps release uploads tied to the selected run ID and avoids behavior changes from repository state at run time. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c1e73bb commit 9fcd74f

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

.github/workflows/release-cuda-pathfinder.yml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,30 @@ jobs:
266266
env:
267267
RUN_ID: ${{ needs.prepare.outputs.run-id }}
268268
steps:
269-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
270-
271269
- name: Download wheels
272270
env:
273271
GH_TOKEN: ${{ github.token }}
274272
run: |
275-
./ci/tools/download-wheels "${RUN_ID}" "cuda-pathfinder" "${{ github.repository }}" "dist"
273+
# Intentionally inline artifact download logic here so publish jobs
274+
# are pinned only to RUN_ID artifacts and do not depend on repo checkout.
275+
mkdir -p dist
276+
gh run download "${RUN_ID}" -p "cuda-pathfinder*" -R "${{ github.repository }}"
277+
shopt -s nullglob globstar
278+
for artifact_dir in cuda-*; do
279+
if [[ ! -d "${artifact_dir}" ]]; then
280+
continue
281+
fi
282+
if [[ "${artifact_dir}" == *-tests ]]; then
283+
echo "Skipping test artifact: ${artifact_dir}"
284+
continue
285+
fi
286+
wheels=( "${artifact_dir}"/**/*.whl )
287+
if (( ${#wheels[@]} > 0 )); then
288+
mv "${wheels[@]}" dist/
289+
fi
290+
done
291+
rm -rf cuda-*
292+
ls -la dist
276293
277294
- name: Publish to TestPyPI
278295
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
@@ -327,13 +344,30 @@ jobs:
327344
env:
328345
RUN_ID: ${{ needs.prepare.outputs.run-id }}
329346
steps:
330-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
331-
332347
- name: Download wheels
333348
env:
334349
GH_TOKEN: ${{ github.token }}
335350
run: |
336-
./ci/tools/download-wheels "${RUN_ID}" "cuda-pathfinder" "${{ github.repository }}" "dist"
351+
# Intentionally inline artifact download logic here so publish jobs
352+
# are pinned only to RUN_ID artifacts and do not depend on repo checkout.
353+
mkdir -p dist
354+
gh run download "${RUN_ID}" -p "cuda-pathfinder*" -R "${{ github.repository }}"
355+
shopt -s nullglob globstar
356+
for artifact_dir in cuda-*; do
357+
if [[ ! -d "${artifact_dir}" ]]; then
358+
continue
359+
fi
360+
if [[ "${artifact_dir}" == *-tests ]]; then
361+
echo "Skipping test artifact: ${artifact_dir}"
362+
continue
363+
fi
364+
wheels=( "${artifact_dir}"/**/*.whl )
365+
if (( ${#wheels[@]} > 0 )); then
366+
mv "${wheels[@]}" dist/
367+
fi
368+
done
369+
rm -rf cuda-*
370+
ls -la dist
337371
338372
- name: Publish to PyPI
339373
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

0 commit comments

Comments
 (0)