github.com/metacubex/mihomo@v1.18.5/.github/release.sh (about) 1 #!/bin/bash 2 3 FILENAMES=$(ls) 4 for FILENAME in $FILENAMES 5 do 6 if [[ ! ($FILENAME =~ ".exe" || $FILENAME =~ ".sh")]];then 7 gzip -S ".gz" $FILENAME 8 elif [[ $FILENAME =~ ".exe" ]];then 9 zip -m ${FILENAME%.*}.zip $FILENAME 10 else echo "skip $FILENAME" 11 fi 12 done 13 14 FILENAMES=$(ls) 15 for FILENAME in $FILENAMES 16 do 17 if [[ $FILENAME =~ ".zip" ]];then 18 echo "rename $FILENAME" 19 mv $FILENAME ${FILENAME%.*}-${VERSION}.zip 20 elif [[ $FILENAME =~ ".gz" ]];then 21 echo "rename $FILENAME" 22 mv $FILENAME ${FILENAME%.*}-${VERSION}.gz 23 else 24 echo "skip $FILENAME" 25 fi 26 done