-
-
Notifications
You must be signed in to change notification settings - Fork 11
96 lines (83 loc) · 3.08 KB
/
Copy pathBuild_all_packages.yml
File metadata and controls
96 lines (83 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build All Transcode for x25 Packages
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-7-4:
name: Build DSM 7.4
uses: ./.github/workflows/Build_package_DSM74.yml
secrets: inherit
build-7-3:
name: Build DSM 7.3
needs: build-7-4
uses: ./.github/workflows/Build_package_DSM73.yml
secrets: inherit
build-7-2:
name: Build DSM 7.2
needs: build-7-3
uses: ./.github/workflows/Build_package_DSM72.yml
secrets: inherit
notify-spkrepo:
runs-on: ubuntu-latest
needs: [build-7-4, build-7-3, build-7-2]
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Checkout this repo (for synology/PACKAGE_ICON.PNG and package.json)
uses: actions/checkout@v4
- name: Checkout 007revad.github.io (for thumbnails/)
uses: actions/checkout@v4
with:
repository: 007revad/007revad.github.io
token: ${{ secrets.SYNC_TOKEN }}
path: _github_io
- name: Install ImageMagick
run: sudo apt-get install -y --no-install-recommends imagemagick
- name: Resize icon and push thumbnail
run: |
set -euo pipefail
# Read package ID from package.json
# package.json may be at the repo root or under synology/ depending on the repo
if [ -f "synology/package.json" ]; then
PKG_JSON="synology/package.json"
elif [ -f "package.json" ]; then
PKG_JSON="package.json"
else
echo "ERROR: package.json not found" >&2
exit 1
fi
PKG_NAME=$(jq -r '.package' "${PKG_JSON}")
DEST="_github_io/spkrepo/thumbnails/${PKG_NAME}_120.png"
# Resize 256x256 PACKAGE_ICON.PNG → 120x120 PNG
mkdir -p "_github_io/spkrepo/thumbnails"
/usr/bin/convert synology/PACKAGE_ICON.PNG \
-resize 120x120 \
-gravity center \
-extent 120x120 \
"${DEST}"
# Commit and push if the thumbnail changed (or is new)
cd _github_io
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add "spkrepo/thumbnails/${PKG_NAME}_120.png"
if git diff --cached --quiet; then
echo "Thumbnail unchanged — skipping commit."
else
git commit -m "chore: update spkrepo thumbnail for ${PKG_NAME} [skip ci]"
git push
fi
- name: Trigger spkrepo index rebuild
run: |
curl -fsSL \
-X POST \
-H "Authorization: Bearer ${{ secrets.SYNC_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/007revad/007revad.github.io/dispatches \
--data '{
"event_type": "spk-release",
"client_payload": {
"repo": "${{ github.repository }}",
"tag": "${{ github.event.release.tag_name }}"
}
}'