Update .gitea/workflows/ci.yml
This commit is contained in:
@@ -288,7 +288,7 @@ jobs:
|
|||||||
SKIN_DIR="$DANSER_SKINS_DIR/$skin_path"
|
SKIN_DIR="$DANSER_SKINS_DIR/$skin_path"
|
||||||
[ ! -d "$SKIN_DIR" ] && { echo "Skipping missing skin directory: $SKIN_DIR"; continue; }
|
[ ! -d "$SKIN_DIR" ] && { echo "Skipping missing skin directory: $SKIN_DIR"; continue; }
|
||||||
|
|
||||||
SKIN_NAME=$(basename "$skin_path" | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
SKIN_NAME=$(basename -- "$skin_path" | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
echo "Processing skin $INDEX/$SKIN_COUNT: $SKIN_NAME"
|
echo "Processing skin $INDEX/$SKIN_COUNT: $SKIN_NAME"
|
||||||
|
|
||||||
ini_file=$(find "$SKIN_DIR" -maxdepth 1 -iname "skin.ini" | head -n1 || true)
|
ini_file=$(find "$SKIN_DIR" -maxdepth 1 -iname "skin.ini" | head -n1 || true)
|
||||||
@@ -358,7 +358,7 @@ jobs:
|
|||||||
for skin_path in "${skin_dirs[@]}"; do
|
for skin_path in "${skin_dirs[@]}"; do
|
||||||
SKIN_DIR="$DANSER_SKINS_DIR/$skin_path"
|
SKIN_DIR="$DANSER_SKINS_DIR/$skin_path"
|
||||||
[ ! -d "$SKIN_DIR" ] && { echo "Skipping missing skin directory: $SKIN_DIR"; continue; }
|
[ ! -d "$SKIN_DIR" ] && { echo "Skipping missing skin directory: $SKIN_DIR"; continue; }
|
||||||
skin_header=$(basename "$skin_path" | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
skin_header=$(basename -- "$skin_path" | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
|
||||||
ini_file=$(find "$SKIN_DIR" -maxdepth 1 -iname "skin.ini" | head -n1 || true)
|
ini_file=$(find "$SKIN_DIR" -maxdepth 1 -iname "skin.ini" | head -n1 || true)
|
||||||
if [ -f "$ini_file" ]; then
|
if [ -f "$ini_file" ]; then
|
||||||
@@ -440,7 +440,7 @@ jobs:
|
|||||||
SKIN_DIR="$DANSER_SKINS_DIR/$skin_path"
|
SKIN_DIR="$DANSER_SKINS_DIR/$skin_path"
|
||||||
[ ! -d "$SKIN_DIR" ] && { echo "Skipping missing skin directory: $SKIN_DIR"; continue; }
|
[ ! -d "$SKIN_DIR" ] && { echo "Skipping missing skin directory: $SKIN_DIR"; continue; }
|
||||||
|
|
||||||
skin_header=$(basename "$skin_path" | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
skin_header=$(basename -- "$skin_path" | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
ini_file=$(find "$SKIN_DIR" -maxdepth 1 -iname "skin.ini" | head -n1 || true)
|
ini_file=$(find "$SKIN_DIR" -maxdepth 1 -iname "skin.ini" | head -n1 || true)
|
||||||
if [ -f "$ini_file" ]; then
|
if [ -f "$ini_file" ]; then
|
||||||
name_line=$(grep -i '^[[:space:]]*name:' "$ini_file" | head -n1 || true)
|
name_line=$(grep -i '^[[:space:]]*name:' "$ini_file" | head -n1 || true)
|
||||||
@@ -677,31 +677,61 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
set -x
|
||||||
|
|
||||||
|
echo "[Cleanup Extraneous Files Started]"
|
||||||
|
echo " DANSER_SKINS_DIR= $DANSER_SKINS_DIR"
|
||||||
|
echo " REPO_SCREENSHOT_DIR=$REPO_SCREENSHOT_DIR"
|
||||||
|
echo " REPO_RANKING_PANEL_DIR=$REPO_RANKING_PANEL_DIR"
|
||||||
|
echo " REPO_MOD_ICONS_DIR=$REPO_MOD_ICONS_DIR"
|
||||||
|
echo " OSK_PATH= $OSK_PATH"
|
||||||
|
|
||||||
rm -rf src/docs || true
|
rm -rf src/docs || true
|
||||||
rm -f how-to-use.md || true
|
rm -f how-to-use.md || true
|
||||||
sanitize_filename() { echo "$1" | sed -e 's#[\\/:\*\?"<>|]#-#g' -e 's#%#_#g' | tr -s ' ' | sed 's/^ *//;s/ *$//'; }
|
|
||||||
|
sanitize_filename() {
|
||||||
|
echo "$1" \
|
||||||
|
| sed -e 's#[\\/:\*\?"<>|]#-#g' -e 's#%#_#g' \
|
||||||
|
| tr -s ' ' \
|
||||||
|
| sed 's/^ *//;s/ *$//'
|
||||||
|
}
|
||||||
|
|
||||||
expected_basenames=()
|
expected_basenames=()
|
||||||
for dir in "$DANSER_SKINS_DIR"/*; do
|
for dir in "$DANSER_SKINS_DIR"/*; do
|
||||||
|
echo " Found skin directory: $dir"
|
||||||
[ -d "$dir" ] || continue
|
[ -d "$dir" ] || continue
|
||||||
|
|
||||||
raw=$(basename "$dir" | tr -d '\r\n')
|
raw=$(basename "$dir" | tr -d '\r\n')
|
||||||
header=$(sanitize_filename "$raw")
|
header=$(sanitize_filename "$raw")
|
||||||
expected_basenames+=("$header")
|
expected_basenames+=("$header")
|
||||||
|
|
||||||
ini=$(find "$dir" -maxdepth 1 -iname skin.ini | head -n1 || true)
|
ini=$(find "$dir" -maxdepth 1 -iname skin.ini | head -n1 || true)
|
||||||
if [ -f "$ini" ]; then
|
if [ -f "$ini" ]; then
|
||||||
name_line=$(grep -i '^[[:space:]]*name:' "$ini" | head -n1)
|
name_line=$({ grep -i '^[[:space:]]*name:' "$ini" || true; } | head -n1)
|
||||||
|
|
||||||
if [ -n "$name_line" ]; then
|
if [ -n "$name_line" ]; then
|
||||||
val="${name_line#*:}"
|
val="${name_line#*:}"
|
||||||
val=$(echo "$val" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
val=$(echo "$val" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
header=$(sanitize_filename "$val")
|
header=$(sanitize_filename "$val")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
expected_basenames+=("$header")
|
expected_basenames+=("$header")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo " Raw expected basenames: ${expected_basenames[*]}"
|
||||||
readarray -t expected_basenames < <(printf "%s\n" "${expected_basenames[@]}" | sort -u)
|
readarray -t expected_basenames < <(printf "%s\n" "${expected_basenames[@]}" | sort -u)
|
||||||
for b in "${expected_basenames[@]}"; do expected_basenames+=("${b}-mod-icons"); done
|
|
||||||
|
for b in "${expected_basenames[@]}"; do
|
||||||
|
expected_basenames+=("${b}-mod-icons")
|
||||||
|
done
|
||||||
readarray -t expected_basenames < <(printf "%s\n" "${expected_basenames[@]}" | sort -u)
|
readarray -t expected_basenames < <(printf "%s\n" "${expected_basenames[@]}" | sort -u)
|
||||||
|
echo " Final expected basenames: ${expected_basenames[*]}"
|
||||||
|
|
||||||
prune_dir() {
|
prune_dir() {
|
||||||
|
echo " Pruning directory: $1"
|
||||||
for f in "$1"/*; do
|
for f in "$1"/*; do
|
||||||
|
echo " Checking: $f"
|
||||||
[ -e "$f" ] || continue
|
[ -e "$f" ] || continue
|
||||||
fn=$(basename "$f")
|
fn=$(basename "$f")
|
||||||
base="${fn%.*}"
|
base="${fn%.*}"
|
||||||
@@ -709,14 +739,22 @@ jobs:
|
|||||||
for kb in "${expected_basenames[@]}"; do
|
for kb in "${expected_basenames[@]}"; do
|
||||||
[ "$base" = "$kb" ] && { keep=true; break; }
|
[ "$base" = "$kb" ] && { keep=true; break; }
|
||||||
done
|
done
|
||||||
$keep || rm -rf "$f"
|
if ! $keep; then
|
||||||
|
echo " → Removing $f"
|
||||||
|
rm -rf "$f"
|
||||||
|
else
|
||||||
|
echo " → Keeping $f"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
prune_dir "$REPO_SCREENSHOT_DIR"
|
prune_dir "$REPO_SCREENSHOT_DIR"
|
||||||
prune_dir "$REPO_RANKING_PANEL_DIR"
|
prune_dir "$REPO_RANKING_PANEL_DIR"
|
||||||
prune_dir "$REPO_MOD_ICONS_DIR"
|
prune_dir "$REPO_MOD_ICONS_DIR"
|
||||||
prune_dir "$OSK_PATH"
|
prune_dir "$OSK_PATH"
|
||||||
|
|
||||||
|
echo "[Cleanup Extraneous Files Complete]"
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Configure Git
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -728,7 +766,13 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git config advice.addIgnoredFile false
|
git config advice.addIgnoredFile false
|
||||||
git add -A media/gameplay media/panel media/icons export README.md
|
|
||||||
|
for p in media/gameplay media/panel media/icons export README.md how-to-use.md src; do
|
||||||
|
if [ -e "$p" ]; then
|
||||||
|
git add -A "$p"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
git commit -m "[ci skip] push back from pipeline" -q || echo "No changes to commit"
|
git commit -m "[ci skip] push back from pipeline" -q || echo "No changes to commit"
|
||||||
|
|
||||||
- name: Push changes and create tag
|
- name: Push changes and create tag
|
||||||
|
|||||||
Reference in New Issue
Block a user