-
-
Notifications
You must be signed in to change notification settings - Fork 8
170 lines (147 loc) · 5.64 KB
/
Build_package_DSM73.yml
File metadata and controls
170 lines (147 loc) · 5.64 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: DSM 7.3 Build n Release Transcode for x25 Package
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-spk:
name: Build Package DSM 7.3
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get release tag
id: get_latest_tag
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "new_tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
else
latest_tag=$(gh release list --limit 1 --json tagName --jq '.[0].tagName')
if [ -z "$latest_tag" ]; then
echo "ERROR: Could not determine release tag" >&2
exit 1
fi
echo "new_tag=$latest_tag" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if SPKs already exist in release
id: check_assets
run: |
existing=$(curl -s "https://api.github.com/repos/007revad/Transcode_for_x25/releases/tags/${{ steps.get_latest_tag.outputs.new_tag }}" \
| jq -r '.assets[].name' | grep -c 'DSM-7.3' || true)
echo "spk_count=$existing" >> $GITHUB_OUTPUT
- name: Stage DSM-version modules
if: steps.check_assets.outputs.spk_count == '0'
run: |
cp package/7.3/*.ko src/lib/modules/
ls -la src/lib/modules/
- name: Set os_min_ver for DSM 7.3
if: steps.check_assets.outputs.spk_count == '0'
run: |
sed -i 's/"os_min_ver": "7.2-72806"/"os_min_ver": "7.3-81180"/' package.json
- name: Show toolkit source tree
if: steps.check_assets.outputs.spk_count == '0'
run: |
find /toolkit/source -type f 2>/dev/null || echo "Toolkit source not populated yet"
- name: Synology Package Builder Github Action
if: steps.check_assets.outputs.spk_count == '0'
#uses: tomgrv/synology-package-builder@v1.3.0
uses: 007revad/synology-package-builder@main
with:
dsm: '7.3'
arch: 'kvmx64'
output: ./dist
- name: Remove debug spk and rename package
if: steps.check_assets.outputs.spk_count == '0'
run: |
ls -l ./dist
rm ./dist/*_debug.spk
for f in ./dist/*.spk; do
mv "$f" "./dist/Transcode_${{ steps.get_latest_tag.outputs.new_tag }}-DSM-7.3-geminilakenk.spk"
done
ls -l ./dist
- name: Upload Package
if: steps.check_assets.outputs.spk_count == '0'
uses: actions/upload-artifact@v4
with:
name: Transcode_DSM-7.3-geminilakenk
path: ./dist/*.spk
- name: Release
if: steps.check_assets.outputs.spk_count == '0'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_latest_tag.outputs.new_tag }}
make_latest: false
fail_on_unmatched_files: false
files: |
./dist/*.spk
notify-spkrepo:
runs-on: ubuntu-latest
needs: [build-spk]
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 }}"
}
}'