-
-
Notifications
You must be signed in to change notification settings - Fork 323
288 lines (282 loc) · 12.8 KB
/
main.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
name: build
on:
push:
branches:
- release
- prerelease
- test
jobs:
build-mac:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew update
brew install ninja mpv qt@5 || true
- name: Release build
run: |
mkdir build
sed -i '' 's|await loadScript('\''qrc:///qtwebchannel/qwebchannel.js'\'');|document.body.style.overscrollBehavior = "none";&|g' native/nativeshell.js
cd build
cmake -GNinja -DQTROOT=/usr/local/opt/qt@5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
ninja install
- name: Fix library paths and create dmg
run: |
python3 ./scripts/fix-install-names.py ./build/output/Jellyfin\ Media\ Player.app
python3 ./scripts/fix-webengine.py ./build/output/Jellyfin\ Media\ Player.app
codesign --force --deep -s - ./build/output/Jellyfin\ Media\ Player.app/
brew install create-dmg
create-dmg --volname "Jellyfin Media Player" --no-internet-enable "JellyfinMediaPlayer.dmg" "./build/output/Jellyfin Media Player.app"
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: macos
path: ${{ github.workspace }}/JellyfinMediaPlayer.dmg
build-macarm64:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew update
brew install ninja mpv qt@5 || true
- name: Release build
run: |
mkdir build
sed -i '' 's|await loadScript('\''qrc:///qtwebchannel/qwebchannel.js'\'');|document.body.style.overscrollBehavior = "none";&|g' native/nativeshell.js
cd build
cmake -GNinja -DQTROOT=/opt/homebrew/opt/qt@5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
ninja install
- name: Fix library paths and create dmg
run: |
python3 ./scripts/fix-install-names.py ./build/output/Jellyfin\ Media\ Player.app
python3 ./scripts/fix-webengine.py ./build/output/Jellyfin\ Media\ Player.app
codesign --force --deep -s - ./build/output/Jellyfin\ Media\ Player.app/
brew install create-dmg
create-dmg --volname "Jellyfin Media Player" --no-internet-enable "JellyfinMediaPlayer.dmg" "./build/output/Jellyfin Media Player.app"
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: macos-arm64
path: ${{ github.workspace }}/JellyfinMediaPlayer.dmg
build-win64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt 5.15.2
uses: jurplel/install-qt-action@v3
with:
version: "5.15.2"
arch: "win64_msvc2019_64"
modules: "qtwebengine"
- name: Install dependencies
run: |
mkdir build
curl -L https://aka.ms/vs/17/release/vc_redist.x64.exe > vc_redist.x64.exe
sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x64.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs
curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
unzip ninja.zip
mv ninja.exe build/
curl -L https://github.com/shinchiro/mpv-winbuild-cmake/releases/download/20240513/mpv-dev-x86_64-20240513-git-61f72bd.7z > mpv.7z
7z x mpv.7z
mkdir mpv
mv include mpv
gendef libmpv-2.dll
mv libmpv-2.dll mpv/libmpv-2.dll
mv libmpv-2.def mpv.def
mv mpv.def libmpv.dll.a mpv/
mv mpv build/
shell: bash
- name: Build
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd build
set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt5_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll -DCMAKE_INSTALL_PREFIX=output ..
lib /def:mpv\mpv.def /out:mpv\libmpv-2.dll.lib /MACHINE:X64
ninja
ninja windows_package
shell: cmd
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*.exe
build-win32:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt 5.15.2
uses: jurplel/install-qt-action@v3
with:
version: "5.15.2"
arch: "win32_msvc2019"
modules: "qtwebengine"
- name: Install dependencies
run: |
mkdir build
curl -L https://aka.ms/vs/17/release/vc_redist.x86.exe > vc_redist.x86.exe
sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x86.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs
curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
unzip ninja.zip
mv ninja.exe build/
curl -L https://github.com/shinchiro/mpv-winbuild-cmake/releases/download/20240513/mpv-dev-i686-20240513-git-61f72bd.7z > mpv.7z
7z x mpv.7z
mkdir mpv
mv include mpv
gendef libmpv-2.dll
mv libmpv-2.dll mpv/libmpv-2.dll
mv libmpv-2.def mpv.def
mv mpv.def libmpv.dll.a mpv/
mv mpv build/
shell: bash
- name: Build
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
cd build
set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt5_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll -DCMAKE_INSTALL_PREFIX=output ..
lib /def:mpv\mpv.def /out:mpv\libmpv-2.dll.lib /MACHINE:X86
ninja
ninja windows_package
shell: cmd
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: windows-legacy32
path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*.exe
build-ubuntu:
strategy:
matrix:
tag: [mantic, noble, jammy]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Install dependencies
sudo apt-get update
sudo apt-get install --yes gnupg debsigs devscripts
- name: Docker Build
run: |
docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=ubuntu deployment
docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} -e IMG=ubuntu builddeb
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: ubuntu-${{ matrix.tag }}
path: ${{ github.workspace }}/deployment/dist/*
- name: Import repository signing GPG key
run: |
echo -n "${{ secrets.DEBIAN_SIGNING_KEY }}" | base64 --decode | gpg --batch --yes --import
- name: Sign Debian package and source files
run: |
for file in deployment/dist/*.deb; do
debsigs --sign=origin --default-key=${{ secrets.DEBIAN_SIGNING_KEY_ID }} ${file}
done
debsign -k ${{ secrets.DEBIAN_SIGNING_KEY_ID }} deployment/dist/*.changes
- name: Remove repository signing GPG key
run: |
gpg --batch --yes --delete-secret-keys ${{ secrets.DEBIAN_SIGNING_KEY_ID }}
- name: Upload artifacts to repository server
uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
source: deployment/dist/*
strip_components: 2
target: "/srv/incoming/client/jellyfin-media-player/ubuntu/{{ matrix.tag }}"
- name: Import artifactsinto reprepro
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
debug: false
script_stop: false
script: |
set -o xtrace
COMPONENT="main"
sudo reprepro --waitforlock 30 --basedir /srv/ubuntu --component ${COMPONENT} includedeb ${{ matrix.tag }} /srv/incoming/client/jellyfin-media-player/ubuntu/{{ matrix.tag }}/*.deb || exit 1
sudo reprepro --waitforlock 30 --basedir /srv/ubuntu --component ${COMPONENT} includedsc ${{ matrix.tag }} /srv/incoming/client/jellyfin-media-player/ubuntu/{{ matrix.tag }}/*.dsc || exit 1
- name: Move artifacts into repository
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
debug: false
script_stop: false
script: |
export BASEDIR="/srv/repository/main/client/jellyfin-media-player/ubuntu"
sudo mkdir -p ${BASEDIR}/stable/${{ github.ref_name }} || exit 1
sudo mv -t ${BASEDIR}/stable/${{ github.ref_name }} /srv/incoming/client/jellyfin-media-player/ubuntu/{{ matrix.tag }}/* || exit 1
sudo rm ${BASEDIR}/latest || true
sudo ln -sf ${BASEDIR}/stable/${{ github.ref_name }} ${BASEDIR}/latest || exit 1
build-debian:
strategy:
matrix:
tag: [bookworm, trixie]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Install dependencies
sudo apt-get update
sudo apt-get install --yes gnupg debsigs devscripts
- name: Docker Build
run: |
docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=debian deployment
docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} -e IMG=debian builddeb
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: debian-${{ matrix.tag }}
path: ${{ github.workspace }}/deployment/dist/*
- name: Import repository signing GPG key
run: |
echo -n "${{ secrets.DEBIAN_SIGNING_KEY }}" | base64 --decode | gpg --batch --yes --import
- name: Sign Debian package and source files
run: |
for file in deployment/dist/*.deb; do
debsigs --sign=origin --default-key=${{ secrets.DEBIAN_SIGNING_KEY_ID }} ${file}
done
debsign -k ${{ secrets.DEBIAN_SIGNING_KEY_ID }} deployment/dist/*.changes
- name: Remove repository signing GPG key
run: |
gpg --batch --yes --delete-secret-keys ${{ secrets.DEBIAN_SIGNING_KEY_ID }}
- name: Upload artifacts to repository server
uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
source: deployment/dist/*
strip_components: 2
target: "/srv/incoming/client/jellyfin-media-player/debian/{{ matrix.tag }}"
- name: Import artifactsinto reprepro
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
debug: false
script_stop: false
script: |
set -o xtrace
COMPONENT="main"
sudo reprepro --waitforlock 30 --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.tag }} /srv/incoming/client/jellyfin-media-player/debian/{{ matrix.tag }}/*.deb || exit 1
sudo reprepro --waitforlock 30 --basedir /srv/debian --component ${COMPONENT} includedsc ${{ matrix.tag }} /srv/incoming/client/jellyfin-media-player/debian/{{ matrix.tag }}/*.dsc || exit 1
- name: Move artifacts into repository
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
debug: false
script_stop: false
script: |
export BASEDIR="/srv/repository/main/client/jellyfin-media-player/debian"
sudo mkdir -p ${BASEDIR}/stable/${{ github.ref_name }} || exit 1
sudo mv -t ${BASEDIR}/stable/${{ github.ref_name }} /srv/incoming/client/jellyfin-media-player/debian/{{ matrix.tag }}/* || exit 1
sudo rm ${BASEDIR}/latest || true
sudo ln -sf ${BASEDIR}/stable/${{ github.ref_name }} ${BASEDIR}/latest || exit 1