@@ -102,6 +102,44 @@ jobs:
102102 needs : [<your-existing-build-job>] # replace with your actual job name(s)
103103 if : github.event_name == 'release' && github.event.action == 'published'
104104 steps :
105+ - name : Checkout this repo (for synology/PACKAGE_ICON.PNG and package.json)
106+ uses : actions/checkout@v4
107+
108+ - name : Checkout 007revad.github.io (for thumbnails/)
109+ uses : actions/checkout@v4
110+ with :
111+ repository : 007revad/007revad.github.io
112+ token : ${{ secrets.SYNC_TOKEN }}
113+ path : _github_io
114+
115+ - name : Resize icon and push thumbnail
116+ run : |
117+ set -euo pipefail
118+
119+ # Read package ID from package.json
120+ PKG_NAME=$(jq -r '.package' synology/package.json)
121+ DEST="_github_io/spkrepo/thumbnails/${PKG_NAME}_120.png"
122+
123+ # Resize 256x256 PACKAGE_ICON.PNG → 120x120 PNG
124+ mkdir -p "_github_io/spkrepo/thumbnails"
125+ convert synology/PACKAGE_ICON.PNG \
126+ -resize 120x120 \
127+ -gravity center \
128+ -extent 120x120 \
129+ "${DEST}"
130+
131+ # Commit and push if the thumbnail changed (or is new)
132+ cd _github_io
133+ git config user.name "github-actions[bot]"
134+ git config user.email "github-actions[bot]@users.noreply.github.com"
135+ git add "spkrepo/thumbnails/${PKG_NAME}_120.png"
136+ if git diff --cached --quiet; then
137+ echo "Thumbnail unchanged — skipping commit."
138+ else
139+ git commit -m "chore: update spkrepo thumbnail for ${PKG_NAME} [skip ci]"
140+ git push
141+ fi
142+
105143 - name : Trigger spkrepo index rebuild
106144 run : |
107145 curl -fsSL \
@@ -117,4 +155,3 @@ jobs:
117155 "tag": "${{ github.event.release.tag_name }}"
118156 }
119157 }'
120-
0 commit comments