Skip to content

Commit ef8a5ca

Browse files
committed
Fix file purging
The rules weren't working properly and the wrong files ended up in the zip. Switch to a regex instead.
1 parent a49ab18 commit ef8a5ca

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -535,30 +535,30 @@ jobs:
535535
# Add ROCm to PATH for current session
536536
echo "/opt/rocm/bin" >> $GITHUB_PATH
537537
538-
# Build case pattern from ${{ env.GPU_TARGETS }}
539-
PATTERN=$(printf '%s' "${{ env.GPU_TARGETS }}" | sed 's/;/\*|\*/g')
538+
# Build regex pattern from ${{ env.GPU_TARGETS }} (match target as substring)
539+
TARGET_REGEX="($(printf '%s' "${{ env.GPU_TARGETS }}" | sed 's/;/|/g'))"
540540
541541
# Remove library files for architectures we're not building for to save disk space
542542
echo "Cleaning up unneeded architecture files..."
543543
cd /opt/rocm/lib/rocblas/library
544544
# Keep only our target architectures
545545
for file in *; do
546-
case "$file" in
547-
$PATTERN)
548-
;;
549-
*)
550-
sudo rm -f "$file" ;;
551-
esac;
546+
if printf '%s' "$file" | grep -q 'gfx'; then
547+
if ! printf '%s' "$file" | grep -Eq "$TARGET_REGEX"; then
548+
echo "Removing $file" &&
549+
sudo rm -f "$file";
550+
fi
551+
fi
552552
done
553553
554554
cd /opt/rocm/lib/hipblaslt/library
555555
for file in *; do
556-
case "$file" in
557-
$PATTERN)
558-
;;
559-
*)
560-
sudo rm -f "$file" ;;
561-
esac;
556+
if printf '%s' "$file" | grep -q 'gfx'; then
557+
if ! printf '%s' "$file" | grep -Eq "$TARGET_REGEX"; then
558+
echo "Removing $file" &&
559+
sudo rm -f "$file";
560+
fi
561+
fi
562562
done
563563
564564
- name: Build

0 commit comments

Comments
 (0)