Update .gitea/workflows/ci.yml

This commit is contained in:
Arlind
2025-06-16 10:55:28 +02:00
parent 834955d09d
commit d006c0ea9b

View File

@@ -685,71 +685,6 @@ jobs:
echo "README generation completed successfully."
- name: Migrate flat assets into per-skin folders
shell: bash
run: |
set -euo pipefail
echo "[Migration of flat assets started]"
sanitize() {
echo "$1" | \
tr -d '\000-\037' | \
sed -e 's#[\\/:\*\?"<>|]#-#g' | \
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
}
readarray -t skins <<< "$ALL_SKINS_DIR"
declare -A hdr2fld
for skin in "${skins[@]}"; do
[[ -z "${skin// }" ]] && continue
header=$(sanitize "$skin")
if ini=$(find "$DANSER_SKINS_DIR/$skin" -maxdepth 1 -type f -iname "skin.ini" -print -quit); then
raw=$(grep -i '^[[:space:]]*Name:' "$ini" | head -n1 || true)
raw="${raw#*:}"
header=$(sanitize "$raw")
if [[ -z "$header" ]]; then
header=$(sanitize "$skin")
fi
echo "DEBUG: raw='$raw' sanitized='$header' for skin='$skin'"
else
echo "DEBUG: no skin.ini found, using fallback: sanitized='$header' for skin='$skin'"
fi
[[ -n "$header" ]] && hdr2fld["$header"]="$skin"
done
migrate() {
local root=$1 ext=$2
echo " → Migrating *.$ext in $root"
shopt -s nullglob
while IFS= read -r f; do
base="${f##*/}"
base="${base%.$ext}"
[[ "$root" == *icons ]] && base="${base%-mod-icons}"
key=$(sanitize "$base")
echo " DEBUG: looking for key='$key' → '${hdr2fld[$key]:-<NONE>}'"
target="${hdr2fld[$key]:-}"
if [[ -n "$target" ]]; then
dst="$root/$target"
mkdir -p "$dst"
echo " • Moving $f → $dst/"
mv "$f" "$dst/"
else
echo " ✖ No mapping for '$base' (key='$key'), leaving $f"
fi
done < <(find "$root" -maxdepth 1 -type f -iname "*.$ext")
find "$root" -mindepth 1 -maxdepth 1 -type d -empty -exec rmdir {} \; || true
shopt -u nullglob
}
migrate "$REPO_SCREENSHOT_DIR" gif
migrate "$REPO_RANKING_PANEL_DIR" png
migrate "$REPO_MOD_ICONS_DIR" png
migrate "$OSK_PATH" osk
echo "[Migration of flat assets complete]"
- name: Cleanup Extra Files
shell: bash
run: |