Add default skin

This commit is contained in:
2025-06-05 20:36:42 +02:00
parent a83045e872
commit 28b486fec0
633 changed files with 1991 additions and 25 deletions

View File

@@ -15,6 +15,8 @@ env:
DANSER_VIDEO_DIR: "/app/danser/videos"
DANSER_SCREENSHOT_DIR: "/app/danser/screenshots"
SKINS_DIR: "${{ github.workspace }}/Skins"
DANSER_SKINS_DIR: "/app/danser/skins"
DEFAULT_SKIN_DIR: "${{ github.workspace }}/src/default-skin"
REPO_SCREENSHOT_DIR: "${{ github.workspace }}/media/gameplay"
REPO_MOD_ICONS_DIR: "${{ github.workspace }}/media/icons"
REPO_RANKING_PANEL_DIR: "${{ github.workspace }}/media/panel"
@@ -52,6 +54,13 @@ jobs:
git lfs pull
echo "LFS files pulled."
- name: Extract PROJECT path without trailing slash
id: extract_project
run: |
PROJECT=${{ github.workspace#'/workspace/' }}
PROJECT=${PROJECT%/}
echo "PROJECT=$PROJECT" >> $GITHUB_ENV
- name: Set XDG_RUNTIME_DIR
run: |
echo "Setting XDG_RUNTIME_DIR..."
@@ -88,14 +97,21 @@ jobs:
echo "new_tag=$new_tag" >> $GITHUB_ENV
echo "Computed new tag: $new_tag"
- name: Move Skin files to Danser Skins directory
run: |
echo "Moving Skin files to Danser Skins directory..."
mkdir -p "$DANSER_SKINS_DIR"
mv "$SKINS_DIR"/* "$DANSER_SKINS_DIR"
echo "Skin files moved."
- name: Generate Danser videos and screenshots
run: |
echo "[Danser Job Started]"
SKIN_COUNT=$(find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
SKIN_COUNT=$(find "$DANSER_SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
INDEX=1
for skin in "$SKINS_DIR"/*/; do
for skin in "$DANSER_SKINS_DIR"/*/; do
if [ -d "$skin" ]; then
SKIN_NAME=$(basename "$skin")
echo ""
@@ -149,9 +165,9 @@ jobs:
echo "[Asset Renaming Started]"
INDEX=1
SKIN_COUNT=$(find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
SKIN_COUNT=$(find "$DANSER_SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
for skin_path in "$SKINS_DIR"/*/; do
for skin_path in "$DANSER_SKINS_DIR"/*/; do
if [ -d "$skin_path" ]; then
SKIN_NAME=$(basename "$skin_path")
@@ -207,10 +223,10 @@ jobs:
group2_icons=$(jq -r '.group2 | join(" ")' "$ICONS_JSON_FILE")
group3_icons=$(jq -r '.group3 | join(" ")' "$ICONS_JSON_FILE")
SKIN_COUNT=$(find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
SKIN_COUNT=$(find "$DANSER_SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
INDEX=1
for skin_path in "$SKINS_DIR"/*/; do
for skin_path in "$DANSER_SKINS_DIR"/*/; do
if [ -d "$skin_path" ]; then
SKIN_NAME=$(basename "$skin_path")
echo ""
@@ -249,8 +265,8 @@ jobs:
if [ -f "$icon_path" ]; then
montage_files="$montage_files \"$icon_path\""
count=$((count + 1))
elif [ -f "$SKINS_DIR/Default/selection-mod-${icon}@2x.png" ]; then
montage_files="$montage_files \"$SKINS_DIR/Default/selection-mod-${icon}@2x.png\""
elif [ -f "$DEFAULT_SKIN_DIR/selection-mod-${icon}@2x.png" ]; then
montage_files="$montage_files \"$DEFAULT_SKIN_DIR/selection-mod-${icon}@2x.png\""
count=$((count + 1))
fi
done
@@ -294,12 +310,12 @@ jobs:
run: |
echo "[OSK Creation Job Started]"
SKIN_COUNT=$(find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
SKIN_COUNT=$(find "$DANSER_SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | wc -l)
INDEX=1
FIXED_TIMESTAMP="2025-01-01 00:00:00"
find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skin; do
find "$DANSER_SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skin; do
SKIN_FOLDER=$(basename "$skin")
echo ""
echo "[$INDEX/$SKIN_COUNT] Processing skin folder: $SKIN_FOLDER"
@@ -373,7 +389,7 @@ jobs:
cp "$ORDER_FILE" "$JSON_SKINS_TMP"
while IFS= read -r skin; do
dir="$SKINS_DIR/$skin"
dir="$DANSER_SKINS_DIR/$skin"
if [ ! -d "$dir" ]; then
echo "Skipping missing skin directory: $skin"
continue
@@ -397,7 +413,7 @@ jobs:
escaped_img=$(echo "$skin_header.gif" | sed 's/ /%20/g')
escaped_osk=$(echo "$skin_header.osk" | sed 's/ /%20/g')
echo "## [$skin_header]($REGISTRY_URL/arlind/skins/media/tag/$new_tag/export/$escaped_osk)" >> "$README_PATH"
echo "## [$skin_header]($REGISTRY_URL/$PROJECT/media/tag/$new_tag/export/$escaped_osk)" >> "$README_PATH"
echo "" >> "$README_PATH"
skin_desc=$(get_desc "$skin")
@@ -434,11 +450,8 @@ jobs:
fi
done < "$ORDER_FILE"
find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | while IFS= read -r dir; do
find "$DANSER_SKINS_DIR" -mindepth 1 -maxdepth 1 -type d | while IFS= read -r dir; do
skin=$(basename "$dir")
if [ "$skin" = "Default" ]; then
continue
fi
ini_file=$(find "$dir" -maxdepth 1 -iname "skin.ini" | head -n 1)
skin_header="$skin"
@@ -519,15 +532,6 @@ jobs:
git config lfs.https://${{ secrets.CONTAINER_REGISTRY }}/arlind/skins.git/info/lfs.locksverify true
echo "Git configured."
- name: Remove Default skin
run: |
echo "Removing Default skin assets if they exist..."
rm -f "$REPO_SCREENSHOT_DIR/Default.gif"
rm -f "$REPO_MOD_ICONS_DIR/Default-mod-icons.png"
rm -f "$REPO_RANKING_PANEL_DIR/Default.png"
rm -f "$OSK_PATH/Default.osk"
echo "Default skin assets removed."
- name: Add and Commit changes
run: |
git config advice.addIgnoredFile false