generated from osc/skins-template
test
This commit is contained in:
@@ -3,7 +3,7 @@ description: "Remove leftover or outdated assets from repository"
|
|||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
all_skins:
|
all_skins:
|
||||||
description: "Newline-delimited list of all skins"
|
description: "JSON array of all skins"
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
@@ -15,7 +15,7 @@ runs:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
echo "[Cleanup Extra Files Started]"
|
echo "[Cleanup Extra Files Started]"
|
||||||
|
|
||||||
readarray -t skins <<< "${{ inputs.all_skins }}"
|
readarray -t skins < <(echo '${{ inputs.all_skins }}' | jq -r '.[]')
|
||||||
|
|
||||||
[ -f how-to-use.md ] && rm -f how-to-use.md
|
[ -f how-to-use.md ] && rm -f how-to-use.md
|
||||||
[ -f src/replay.osr ] && rm -f src/replay.osr
|
[ -f src/replay.osr ] && rm -f src/replay.osr
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ outputs:
|
|||||||
description: "Path to file containing changed skins"
|
description: "Path to file containing changed skins"
|
||||||
value: ${{ steps.detect.outputs.changed_skins_file }}
|
value: ${{ steps.detect.outputs.changed_skins_file }}
|
||||||
all_skins:
|
all_skins:
|
||||||
description: "All discovered skins (newline-delimited list)"
|
description: "All discovered skins (JSON array)"
|
||||||
value: ${{ steps.discover_all.outputs.all_skins }}
|
value: ${{ steps.discover_all.outputs.all_skins }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
@@ -31,14 +31,8 @@ runs:
|
|||||||
find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d \
|
find "$SKINS_DIR" -mindepth 1 -maxdepth 1 -type d \
|
||||||
| sed 's|'"$SKINS_DIR"'/||'
|
| sed 's|'"$SKINS_DIR"'/||'
|
||||||
)
|
)
|
||||||
# Write all skins to output
|
json=$(printf '%s\n' "${skins[@]}" | jq -R . | jq -s .)
|
||||||
{
|
echo "all_skins=$json" >> "$GITHUB_OUTPUT"
|
||||||
echo "all_skins<<EOF"
|
|
||||||
for s in "${skins[@]}"; do
|
|
||||||
echo "$s"
|
|
||||||
done
|
|
||||||
echo "EOF"
|
|
||||||
} >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Detect Changed Skin Directories
|
- name: Detect Changed Skin Directories
|
||||||
id: detect
|
id: detect
|
||||||
@@ -46,7 +40,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
echo "[Detect Changed Skin Directories Started]"
|
echo "[Detect Changed Skin Directories Started]"
|
||||||
|
|
||||||
readarray -t all_skins <<< "${{ steps.discover_all.outputs.all_skins }}"
|
readarray -t all_skins < <(echo '${{ steps.discover_all.outputs.all_skins }}' | jq -r '.[]')
|
||||||
|
|
||||||
force_rebuild="${{ inputs.force_rebuild }}"
|
force_rebuild="${{ inputs.force_rebuild }}"
|
||||||
target_skins="${{ inputs.target_skins }}"
|
target_skins="${{ inputs.target_skins }}"
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ description: "Setup environment dirs and create directories for assets"
|
|||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
all_skins:
|
all_skins:
|
||||||
description: "Newline-delimited list of all skins"
|
description: "JSON array of all skins"
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
user_repository:
|
user_repository:
|
||||||
description: "Path of the repository (relative inside container)"
|
description: "Path of the repository (relative inside container)"
|
||||||
|
value: ${{ steps.repo.outputs.user_repository }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
@@ -39,7 +40,7 @@ runs:
|
|||||||
echo "Creating base directories for assets..."
|
echo "Creating base directories for assets..."
|
||||||
mkdir -p "$REPO_SCREENSHOT_DIR" "$REPO_MOD_ICONS_DIR" "$REPO_RANKING_PANEL_DIR" "$OSK_PATH" "$REPO_THUMBNAIL_DIR"
|
mkdir -p "$REPO_SCREENSHOT_DIR" "$REPO_MOD_ICONS_DIR" "$REPO_RANKING_PANEL_DIR" "$OSK_PATH" "$REPO_THUMBNAIL_DIR"
|
||||||
|
|
||||||
while IFS= read -r skin; do
|
echo '${{ inputs.all_skins }}' | jq -r '.[]' | while IFS= read -r skin; do
|
||||||
[ -z "$skin" ] && continue
|
[ -z "$skin" ] && continue
|
||||||
echo " → Creating subdirs for '$skin'…"
|
echo " → Creating subdirs for '$skin'…"
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
@@ -48,7 +49,7 @@ runs:
|
|||||||
"$REPO_RANKING_PANEL_DIR/$skin" \
|
"$REPO_RANKING_PANEL_DIR/$skin" \
|
||||||
"$OSK_PATH/$skin" \
|
"$OSK_PATH/$skin" \
|
||||||
"$REPO_THUMBNAIL_DIR/$skin"
|
"$REPO_THUMBNAIL_DIR/$skin"
|
||||||
done <<< "${{ inputs.all_skins }}"
|
done
|
||||||
|
|
||||||
echo "All asset directories created."
|
echo "All asset directories created."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user