From 318e18824519436337c7a9969cc8cf4e3a6bb7f5 Mon Sep 17 00:00:00 2001 From: jatinkrmalik Date: Wed, 11 Feb 2026 20:02:15 -0800 Subject: [PATCH] fix(ci): handle both wheel and tar.gz file renaming in nightly builds The sed pattern didn't correctly match tar.gz files which don't have a dash after the version number. Fixed by explicitly handling both .whl and .tar.gz file extensions with proper naming patterns. Fixes the error: 'mv: source and destination are the same file' --- .github/workflows/nightly.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d489b15..f6596af 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -62,9 +62,20 @@ jobs: for file in dist/*; do base=$(basename "$file") if [[ "$base" == vocalinux-* ]]; then - # Rename vocalinux-0.5.0b0-py3-none-any.whl -> vocalinux-0.5.0b0.dev20250211+g1234567-py3-none-any.whl - newname=$(echo "$base" | sed "s/vocalinux-\([^-]*\)-/vocalinux-${{ steps.version.outputs.version }}-/") - mv "$file" "dist/$newname" + # Extract the file extension + if [[ "$base" == *.whl ]]; then + # vocalinux-0.5.0b0-py3-none-any.whl -> vocalinux-0.5.0b0.dev20250211+g1234567-py3-none-any.whl + newname="vocalinux-${{ steps.version.outputs.version }}-py3-none-any.whl" + elif [[ "$base" == *.tar.gz ]]; then + # vocalinux-0.5.0b0.tar.gz -> vocalinux-0.5.0b0.dev20250211+g1234567.tar.gz + newname="vocalinux-${{ steps.version.outputs.version }}.tar.gz" + else + # Fallback: replace version in filename + newname=$(echo "$base" | sed 's/vocalinux-[^[:space:]]*/vocalinux-${{ steps.version.outputs.version }}/') + fi + if [[ "$base" != "$newname" ]]; then + mv "$file" "dist/$newname" + fi fi done ls -la dist/