From e9f3ccac85d701cd93cd853b7d1cab245f71b673 Mon Sep 17 00:00:00 2001 From: Yuichiro MASUI Date: Fri, 8 Sep 2023 19:14:30 +0900 Subject: [PATCH] Update openscad_build.yml --- .github/workflows/openscad_build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/openscad_build.yml b/.github/workflows/openscad_build.yml index 0f8c245..9485657 100644 --- a/.github/workflows/openscad_build.yml +++ b/.github/workflows/openscad_build.yml @@ -1,4 +1,4 @@ -name: Generate STL and WebP Thumbnails using OpenSCAD +name: Generate STL and Thumbnails using OpenSCAD on: push: @@ -38,16 +38,15 @@ jobs: done ' - - name: Convert PNG thumbnails to WebP run: | for png in $(find . -name "*.png"); do cwebp $png -o ${png%.png}.webp done - - name: Clean up directory (Only keep STL and WebP files) + - name: Clean up directory (Only keep STL, WebP, and txt files) run: | - find . ! -path "./.git/*" ! -name ".git" -type f ! \( -name "*.stl" -o -name "*.webp" \) -delete + find . ! -path "./.git/*" ! -name ".git" -type f ! \( -name "*.stl" -o -name "*.webp" -o -name "*.txt" \) -delete - name: Generate index.html run: | @@ -57,6 +56,10 @@ jobs: echo "

$dirName

" >> index.html for webp in $(find $dir -name "*.webp"); do baseName=$(basename -s .webp $webp) + txtPath="${webp%.webp}.txt" + if [[ -f $txtPath ]]; then + echo "

$(cat $txtPath | sed 's/$/
/')

" >> index.html + fi echo "" >> index.html done echo "
" >> index.html