Skip to content

Commit 4b073e8

Browse files
committed
fix release asset name collision
1 parent b58e038 commit 4b073e8

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,32 @@ jobs:
247247
if: runner.os != 'Windows'
248248
id: find_wheel_unix
249249
shell: bash
250+
env:
251+
SUPPORT: ${{ matrix.pccl_build_cuda_support }}
250252
run: |
251253
for file in "${{ github.workspace }}/python/framework/dist/"*pccl*.whl; do
252254
echo "wheel_path=$file" >> "$GITHUB_OUTPUT"
253-
echo "wheel_name=${file##*/}" >> "$GITHUB_OUTPUT"
255+
base="${file##*/}"
256+
name="${base%.whl}"
257+
if [[ "$SUPPORT" == "ON" ]]; then suffix="cuda"; else suffix="nocuda"; fi
258+
echo "wheel_name=${name}-${suffix}.whl" >> "$GITHUB_OUTPUT"
254259
break
255260
done
256261
257262
- name: Find Python wheel (Windows)
258263
if: runner.os == 'Windows'
259264
id: find_wheel_windows
260265
shell: powershell
266+
env:
267+
SUPPORT: ${{ matrix.pccl_build_cuda_support }}
261268
run: |
262269
$file = Get-ChildItem -Path "${{ github.workspace }}\python\framework\dist" -Filter "*pccl*.whl" | Select-Object -First 1
263270
echo "wheel_path=$($file.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8
264-
echo "wheel_name=$($file.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8
271+
$base = $file.Name
272+
$name = [System.IO.Path]::GetFileNameWithoutExtension($base)
273+
if ($env:SUPPORT -eq 'ON') { $suffix = 'cuda' } else { $suffix = 'nocuda' }
274+
$newName = "$name-$suffix.whl"
275+
echo "wheel_name=$newName" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8
265276
266277
- name: Upload Release Asset
267278
uses: actions/upload-release-asset@v1
@@ -270,5 +281,5 @@ jobs:
270281
with:
271282
upload_url: ${{ needs.create_release.outputs.upload_url }}
272283
asset_path: ${{ runner.os == 'Windows' && steps.find_wheel_windows.outputs.wheel_path || steps.find_wheel_unix.outputs.wheel_path }}
273-
asset_name: ${{ replace(runner.os == 'Windows' && steps.find_wheel_windows.outputs.wheel_name || steps.find_wheel_unix.outputs.wheel_name, '.whl', matrix.pccl_build_cuda_support == 'ON' && 'cuda.whl' || 'nocuda.whl') }}
284+
asset_name: ${{ runner.os == 'Windows' && steps.find_wheel_windows.outputs.wheel_name || steps.find_wheel_unix.outputs.wheel_name }}
274285
asset_content_type: application/zip

0 commit comments

Comments
 (0)