-
Notifications
You must be signed in to change notification settings - Fork 34
304 lines (270 loc) · 11.8 KB
/
build-new-release.yml
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
name: Build New Release
on:
repository_dispatch:
types: [build_new_release]
workflow_dispatch:
inputs:
webReleaseTagName:
description: 'The tag name for the jellyfin-web release'
required: true
type: string
rawMarkdown:
description: 'Raw markdown for the release description'
required: false
default: ''
type: string
prerelease:
description: 'Set if the release should be marked as a prerelease'
required: false
default: false
type: boolean
env:
TIZEN_STUDIO_VER: 4.5.1
TIZEN_STUDIO_URL: https://download.tizen.org/sdk/Installer/tizen-studio_$TIZEN_STUDIO_VER/web-cli_Tizen_Studio_$TIZEN_STUDIO_VER_ubuntu-64.bin
TIZEN_STUDIO_FILE: web-cli_Tizen_Studio_$TIZEN_STUDIO_VER_ubuntu-64.bin
jobs:
run-info:
name: Show run info
runs-on: ubuntu-latest
steps:
- name: Output Inputs
run: echo "${{ toJSON(github.event.inputs) }}"
build:
name: Build artifacts
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin
- tag: release-10.10.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.10.z
- tag: release-10.9.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.9.z
- tag: master
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-master
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-intros
inject_intros: true
- tag: release-10.10.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.10.z-intros
inject_intros: true
- tag: release-10.9.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.9.z-intros
inject_intros: true
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-TrueHD
true_hd: true
- tag: release-10.10.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.10.z-TrueHD
true_hd: true
- tag: release-10.9.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.9.z-TrueHD
true_hd: true
- tag: master
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-master-TrueHD
true_hd: true
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-intros-TrueHD
true_hd: true
inject_intros: true
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-secondary
secondary: true
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-secondary-intros
secondary: true
inject_intros: true
- tag: release-10.10.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.10.z-secondary
secondary: true
- tag: release-10.9.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.9.z-secondary
secondary: true
- tag: release-10.10.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.10.z-secondary-intros
secondary: true
inject_intros: true
- tag: release-10.9.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.9.z-secondary-intros
secondary: true
inject_intros: true
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-OblongIcon
oblong_icon: true
- tag: release-10.10.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.10.z-OblongIcon
oblong_icon: true
- tag: release-10.9.z
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-10.9.z-OblongIcon
oblong_icon: true
- tag: master
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-master-OblongIcon
oblong_icon: true
- tag: ${{ github.event.inputs.webReleaseTagName }}
repository: jellyfin/jellyfin-web
artifact_name: Jellyfin-intros-OblongIcon
inject_intros: true
oblong_icon: true
steps:
- run: env
- name: 'Checkout'
uses: actions/checkout@v1
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '>=20'
- name: Install Needed packages
run: sudo apt install expect
- name: Download Tizen-Studio
run: |
curl -o tizen-installer "https://download.tizen.org/sdk/Installer/tizen-studio_${TIZEN_STUDIO_VER}/web-cli_Tizen_Studio_${TIZEN_STUDIO_VER}_ubuntu-64.bin"
- name: Install Tizen-Studio
run: |
chmod +x tizen-installer
./tizen-installer --accept-license "${GITHUB_WORKSPACE}/tizen-studio"
rm ./tizen-installer
echo 'export PATH=$PATH:/tizen-studio/tools/ide/bin' >> .bashrc
- name: Prepare Tizen Certificate
run: |
# echo $CERTIFICATE_CONTENT > "${GITHUB_WORKSPACE}/tizencert.p12"
# ./tizen-studio/tools/ide/bin/tizen certificate -a Jellyfin -p 1234 -c NZ -s Aukland -ct Aukland -o Tizen -n Jellyfin -e [email protected] -f tizencert
./tizen-studio/tools/ide/bin/tizen security-profiles add -n Jellyfin -a "${GITHUB_WORKSPACE}/tizencert.p12" -p 1234
./tizen-studio/tools/ide/bin/tizen cli-config "profiles.path=${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml"
chmod 755 "${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml"
env:
CERTIFICATE_CONTENT: ${{ secrets.TIZEN_CERT }}
- name: Clone jellyfin-tizen
uses: actions/checkout@v4
with:
repository: 'jellyfin/jellyfin-tizen'
path: 'jellyfin-tizen'
ref: ${{ matrix.legacy == true && '8ebbd10643c10033223d6bf1d7fd7d59fba28fe1' || 'master' }}
- name: Clone jellyfin-web
uses: actions/checkout@v4
with:
repository: ${{ matrix.repository }}
path: 'jellyfin-web'
ref: ${{ matrix.tag }}
- name: Build jellyfin-web
run: |
cd jellyfin-web
if ${{ matrix.legacy == true }}; then
SKIP_PREPARE=1 npm ci --no-audit
npm run build:production
else
npm ci --no-audit
USE_SYSTEM_FONTS=1 npm run build:production
fi
if ${{ matrix.inject_intros == true }}; then
wget -O dist/inject-intros.js https://raw.githubusercontent.com/intro-skipper/intro-skipper/refs/heads/10.10/IntroSkipper/Configuration/inject.js
sed -i 's/<\/head>/<script src="inject-intros.js"><\/script><\/head>/g' dist/index.html
fi
- name: Build jellyfin-tizen
id: buildMaster
run: |
cd jellyfin-tizen
if ${{ matrix.true_hd == true }}; then
sed -i 's/enableSsaRender: true/enableSsaRender: true, supportsTrueHd: true/g' tizen.js
fi
if ${{ matrix.secondary == true }}; then
sed -i 's/AprZAARz4r/JepZAARz4r/g' config.xml
sed -i 's/<name>Jellyfin<\/name>/<name>Jellyfin 2<\/name>/g' config.xml
rm icon.png
mv ../icon2.png icon.png
fi
if ${{ matrix.oblong_icon == true }}; then
rm icon.png
mv ../iconoblong.png icon.png
fi
if ${{ matrix.legacy == true }}; then
DISCARD_UNUSED_FONTS=1 JELLYFIN_WEB_DIR=../jellyfin-web/dist npm ci --no-audit
else
JELLYFIN_WEB_DIR=../jellyfin-web/dist npm ci --no-audit
fi
- name: Build Package
if: success() || steps.buildMaster.conclusion == 'success'
run: |
cd jellyfin-tizen
../tizen-studio/tools/ide/bin/tizen build-web -e ".*" -e gulpfile.js -e README.md -e "node_modules/*" -e "package*.json" -e "yarn.lock"
- name: Prepare for password prompt
if: success() || steps.buildMaster.conclusion == 'success'
run: |
sed -i "s|${GITHUB_WORKSPACE}/tizencert.pwd|1234|g" ${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml
sed -i "s|${GITHUB_WORKSPACE}/tizen-studio-data/tools/certificate-generator/certificates/distributor/tizen-distributor-signer.pwd|tizenpkcs12passfordsigner|g" ${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml
sed -i 's|password=""|password="tizenpkcs12passfordsigner"|g' ${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml
- name: Package WGT
if: success() || steps.buildMaster.conclusion == 'success'
run: |
expect ./package.exp
if ${{ matrix.artifact_name != 'Jellyfin' }}; then
if ${{ matrix.secondary == true }}; then
mv "./jellyfin-tizen/release/Jellyfin 2.wgt" "./jellyfin-tizen/release/${{ matrix.artifact_name }}.wgt"
else
mv "./jellyfin-tizen/release/Jellyfin.wgt" "./jellyfin-tizen/release/${{ matrix.artifact_name }}.wgt"
fi
fi
- name: Print logs
if: always()
run: cat ./tizen-studio-data/cli/logs/cli.log
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: jellyfin-tizen/release/${{ matrix.artifact_name }}.wgt
retention-days: 5
release:
name: Publish the release
runs-on: ubuntu-latest
needs: build
steps:
- name: Get current date
id: date
run: |
echo "date_tag=$(date +'%Y-%m-%d-%H%M')" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_OUTPUT
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: List all directories
run: ls
- name: Check if any artifacts exists
shell: bash
run: |
count=$(find . -type f -name '*.wgt' -printf x | wc -c)
if [ $count -le 0 ]; then
echo "::error title=NoWGT::No wgt files were built"
exit 1
fi
- name: Release Build Result
uses: softprops/action-gh-release@v2
with:
tag_name: '${{ steps.date.outputs.date_tag }}'
name: '${{ steps.date.outputs.date }}'
files: |
**/*.wgt
body: "${{ github.event.inputs.rawMarkdown }}\n\nLook at the [readme](https://github.com/jeppevinkel/jellyfin-tizen-builds/blob/master/README.md) for information about the different versions.\n## Normal Version\nJellyfin-Web: [${{ github.event.inputs.webReleaseTagName }}](https://github.com/jellyfin/jellyfin-web/releases/tag/${{ github.event.inputs.webReleaseTagName }}) \n## 10.9.z Version\nJellyfin-web: [release-10.9.z](https://github.com/jellyfin/jellyfin-web/tree/release-10.9.z) \n## 10.8.z Version\nJellyfin-web: [release-10.8.z](https://github.com/jellyfin/jellyfin-web/tree/release-10.8.z) \n## Master Version\nJellyfin-web: [master](https://github.com/jellyfin/jellyfin-web)"
prerelease: ${{ github.event.inputs.prerelease }}