-
-
Notifications
You must be signed in to change notification settings - Fork 2
531 lines (462 loc) · 23.3 KB
/
c-cpp.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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
name: CI
on: [push, pull_request]
jobs:
native:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout onto ${{ runner.os }}
uses: actions/[email protected]
- name: Setup C++ environment
uses: kurocha/setup-cpp@v1
- name: Install Qt
uses: jurplel/[email protected]
- name: Version
run: echo "::set-output name=version::$(head -n 1 ./QtVsPlayer.pro| cut -d ' ' -f 3)"
id: version
- name: Rel
run: echo "::set-output name=rel::$(grep "%global Rel" ./QtVsPlayermga8wally.spec | cut -d ' ' -f 3)"
id: rel
- name: Update Version and Release
run: |
sed -i 's/\(VERSION = \).*/\1 ${{ steps.version.outputs.version }}/' QtVsPlayer.pro
sed -i 's/\(RELEASE = \).*/\1 ${{ steps.Rel.outputs.rel }}/' QtVsPlayer.pro
- name: Prepare install dir
run: |
sudo apt update
sudo apt install -y chrpath libopenal-dev
mkdir -p .debpkg
# create DEBIAN directory if you want to add other pre/post scripts
mkdir -p .debpkg/DEBIAN
cat <<'EOF' > .debpkg/DEBIAN/postinst
if [ ! -d "/usr/lib64/QtVsPlayer" ];
then
ln -sr /usr/lib64/QtVsPlayer /usr/lib/
fi
if [ -f "/usr/lib64/QtVsPlayer/libopenal.so.1" ];
then
rm -fr /usr/lib64/QtVsPlayer/libopenal.so.1
fi
ln -sr $(whereis "libopenal.so.1" | sed "s|.* \(.*libopenal.so.1\).*|\1|") /usr/lib64/QtVsPlayer
cat <<'EOT' > /etc/ld.so.conf.d/QtVsPlayer.conf
/usr/lib64/QtVsPlayer/
/usr/lib64/QtVsPlayer/HCNetSDKCom/
EOT
/sbin/ldconfig
/sbin/ldconfig /usr/lib64/QtVsPlayer/
add-apt-repository ppa:surfzoid/hikvision -y
EOF
cat <<'EOF' > .debpkg/DEBIAN/prerm
if [ -f "/usr/lib64/QtVsPlayer/libopenal.so.1" ];
then
rm -fr /usr/lib64/QtVsPlayer/libopenal.so.1
fi
EOF
chmod +x .debpkg/DEBIAN/postinst
chmod +x .debpkg/DEBIAN/prerm
echo -e "Automatic build from GitHub action, see QtVsPlayermga8wally.spec for change log" > CHANGELOG
- name: qmake
run: PREFIX=.debpkg/usr/share; qmake
env:
PREFIX: .debpkg/usr/share
INSTALL_ROOT: .debpkg/usr/share
- name: make
run: make
- name: make check
run: make check
- name: make install
run: INSTALL_ROOT=.debpkg/usr/share; make install
- name: build-deb-action
uses: jiro4989/[email protected]
with:
package: QtVsPlayer
package_root: .debpkg
maintainer: surfzoid
version: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }} # ${{ github.ref }} # refs/tags/v*.*.*
arch: 'amd64'
depends: 'libqt5multimedia5, libqt5multimediawidgets5' #libc6 (>= 2.2.1),
desc: 'QtVsPlayer can read local video files of Hikvision and display blue, green and red vector.'
- name: del DEBIAN
run: |
sudo rm -fr .debpkg/DEBIAN
- name: Build RPM package
run: |
set -x
rm -fr /tmp/work
mkdir /tmp/work
mv .debpkg/usr/share/doc/QtVsPlayer .debpkg/usr/share/doc/QtVsPlayer-${{ steps.version.outputs.version }}
mv .debpkg/usr/share/licenses/QtVsPlayer .debpkg/usr/share/licenses/QtVsPlayer-${{ steps.version.outputs.version }}
cp -rp .debpkg /tmp/work/QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
mkdir -p ~/rpmbuild/{SRPMS,SOURCES,SPECS,tmp}
cp -pf QtVsPlayermga8wally.spec ~/rpmbuild/SPECS
cp -pf QtVsPlayer-fix.patch ~/rpmbuild/SPECS
sed -i 's/\(Source0:\).*/\1 tmp.tar.gz/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
# sed -i 's/"%autosetup -n %{name}-%{version}-%{Rel}"/"%autosetup -n %{name}-%{version}"/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
# sed -i 's/\(Release:\).*/\1 1/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/VERSION = /d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/RELEASE = /d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^BuildRequires/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^Requires/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^%qmake_qt5/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^%make_build/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i 's/\(make_install\).*/\1\ncp -fr %{_builddir}\/QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}\/* %{buildroot}/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^%make_install/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^rm -rf %{buildroot}%{_datadir}/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -ir '/\%post/adnf copr enable surfzoid/HikNetExtractor' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -ir '/\%post/adnf copr enable surfzoid/QtVsPlayer' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
cd /tmp/work
tar czf tmp.tar.gz QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}/
mv tmp.tar.gz ~/rpmbuild/SOURCES
rpmbuild -ba ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
cp -f ~/rpmbuild/RPMS/x86_64/QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}* ${{ github.workspace }}
cp -f ~/rpmbuild/SRPMS/QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}* ${{ github.workspace }}
- name: Rename package with te good arch/distro
run: |
for f in $(find ./|grep -i "deb$"); do
echo -e $f
echo ${f//amd64/${{ matrix.os }}-amd64}
ef=${f//amd64/${{ matrix.os }}-amd64}
echo $ef
mv $f $ef
done
- name: Create Github Release
uses: ncipollo/[email protected]
id: create_release
with:
artifacts: "QtVsPlayer-${{ steps.version.outputs.version }}*,QtVsPlayer_${{ steps.version.outputs.version }}*,QtVsPlayer-debuginfo*"
replacesArtifacts: true
token: ${{ github.TOKEN }}
allowUpdates: true
name: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
tag: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
body: "Automatic build from GitHub action, see [QtVsPlayermga8wally.spec](https://github.com/surfzoid/QtVsPlayer/blob/main/QtVsPlayermga8wally.spec#L138) for change log"
- name: clean
run:
rm -fr .debpkg
- name: irc push
uses: rectalogic/notify-irc@v1
if: github.event_name == 'push'
with:
channel: "#QtVsPlayer"
server: "irc.libera.chat"
nickname: my-github-notifier
message: |
${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }}
${{ join(github.event.commits.*.message) }}
- name: irc pull request
uses: rectalogic/notify-irc@v1
if: github.event_name == 'pull_request'
with:
channel: "#QtVsPlayer"
server: "irc.libera.chat"
nickname: my-github-notifier
message: |
${{ github.actor }} opened PR ${{ github.event.pull_request.html_url }}
- name: irc tag created
uses: rectalogic/notify-irc@v1
if: github.event_name == 'create' && github.event.ref_type == 'tag'
with:
channel: "#QtVsPlayer"
server: "irc.libera.chat"
nickname: my-github-notifier
message: |
${{ github.actor }} tagged ${{ github.repository }} ${{ github.event.ref }}
cross:
name: RPI_P400-ARM64
runs-on: [self-hosted, Linux, ARM64]
steps:
- uses: actions/[email protected]
- name: Version
run: echo "::set-output name=version::$(head -n 1 ./QtVsPlayer.pro| cut -d ' ' -f 3)"
id: version
- name: Rel
run: echo "::set-output name=rel::$(grep "%global Rel" ./QtVsPlayermga8wally.spec | cut -d ' ' -f 3)"
id: rel
- name: Update Version and Release
run: |
sed -i 's/\(VERSION = \).*/\1 ${{ steps.version.outputs.version }}/' QtVsPlayer.pro
sed -i 's/\(RELEASE = \).*/\1 ${{ steps.Rel.outputs.rel }}/' QtVsPlayer.pro
- name: Prepare install dir
run: |
# create DEBIAN directory if you want to add other pre/post scripts
mkdir -p .debpkg/DEBIAN
cat <<'EOF' > .debpkg/DEBIAN/postinst
if [ ! -d "/usr/lib64/QtVsPlayer" ];
then
ln -sr /usr/lib64/QtVsPlayer /usr/lib/
fi
if [ -f "/usr/lib64/QtVsPlayer/libopenal.so.1" ];
then
rm -fr /usr/lib64/QtVsPlayer/libopenal.so.1
fi
ln -sr $(whereis "libopenal.so.1" | sed "s|.* \(.*libopenal.so.1\).*|\1|") /usr/lib64/QtVsPlayer
cat <<'EOT' > /etc/ld.so.conf.d/QtVsPlayer.conf
/usr/lib64/QtVsPlayer/
/usr/lib64/QtVsPlayer/HCNetSDKCom/
EOT
/sbin/ldconfig
/sbin/ldconfig /usr/lib64/QtVsPlayer/
add-apt-repository ppa:surfzoid/hikvision -y
EOF
cat <<'EOF' > .debpkg/DEBIAN/prerm
if [ -f "/usr/lib64/QtVsPlayer/libopenal.so.1" ];
then
rm -fr /usr/lib64/QtVsPlayer/libopenal.so.1
fi
EOF
chmod +x .debpkg/DEBIAN/postinst
chmod +x .debpkg/DEBIAN/prerm
echo -e "Automatic build from GitHub action, see QtVsPlayermga8wally.spec for change log" > CHANGELOG
- name: qmake
run: PREFIX=.debpkg/usr/share; qmake
env:
PREFIX: .debpkg/usr/share
INSTALL_ROOT: .debpkg/usr/share
- name: make
run: make
- name: make check
run: make check
- name: make install
run: INSTALL_ROOT=.debpkg/usr/share; make install
- name: Installed-Size
run: echo "::set-output name=installed::$(echo `du -s .debpkg/usr` | awk '{print $1;}')"
id: size
- name: Build control file
run: |
cat << 'EOF' > .debpkg/DEBIAN/control
Package: QtVsPlayer
Version: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
Installed-Size: ${{ steps.installed.outputs.size }}
Architecture: arm64
Maintainer: surfzoid
Depends: libc6 (>= 2.31),libqt5multimedia5:arm64, libqt5multimediawidgets5:arm64
Description: QtVsPlayer can read local video files of Hikvision and display blue, green and red vector.
EOF
- name: Build debian package
run: |
dpkg-deb -b .debpkg QtVsPlayer_${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}_`lsb_release -cs`-arm64.deb
- name: del DEBIAN
run: sudo rm -fr .debpkg/DEBIAN
- name: Build RPM package
run: |
set -x
rm -fr /home/pi/rpmbuild/RPMS/aarch64/*
rm -fr /home/pi/rpmbuild/SRPMS/*
rm -fr /tmp/work
mkdir /tmp/work
mv .debpkg/usr/share/doc/QtVsPlayer .debpkg/usr/share/doc/QtVsPlayer-${{ steps.version.outputs.version }}
mv .debpkg/usr/share/licenses/QtVsPlayer .debpkg/usr/share/licenses/QtVsPlayer-${{ steps.version.outputs.version }}
cp -rp .debpkg /tmp/work/QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
mkdir -p ~/rpmbuild/{SRPMS,SOURCES,SPECS,tmp}
cp -pf QtVsPlayermga8wally.spec ~/rpmbuild/SPECS
cp -pf QtVsPlayer-fix.patch ~/rpmbuild/SPECS
sed -i 's/\(Source0:\).*/\1 tmp.tar.gz/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
# sed -i 's/"%autosetup -n %{name}-%{version}-%{Rel}"/"%autosetup -n %{name}-%{version}"/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
# sed -i 's/\(Release:\).*/\1 1/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/VERSION = /d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/RELEASE = /d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^BuildRequires/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^Requires/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^%qmake_qt5/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^%make_build/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i 's/\(make_install\).*/\1\ncp -fr %{_builddir}\/QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}\/* %{buildroot}/' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^%make_install/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -i '/^rm -rf %{buildroot}%{_datadir}/d' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -ir '/\%post/adnf copr enable surfzoid/HikNetExtractor' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
sed -ir '/\%post/adnf copr enable surfzoid/QtVsPlayer' ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
cd /tmp/work
tar czf tmp.tar.gz QtVsPlayer-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}/
mv tmp.tar.gz ~/rpmbuild/SOURCES
rpmbuild -ba ~/rpmbuild/SPECS/QtVsPlayermga8wally.spec
cp -f ~/rpmbuild/RPMS/aarch64/QtVsPlayer-${{ steps.version.outputs.version }}* ${{ github.workspace }}
cp -f ~/rpmbuild/SRPMS/QtVsPlayer-${{ steps.version.outputs.version }}* ${{ github.workspace }}
- name: Create Github Release
uses: ncipollo/[email protected]
id: create_release
with:
artifacts: "QtVsPlayer-${{ steps.version.outputs.version }}*,QtVsPlayer_${{ steps.version.outputs.version }}*,QtVsPlayer-debuginfo*"
replacesArtifacts: true
token: ${{ github.TOKEN }}
allowUpdates: true
name: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
tag: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
body: "Automatic build from GitHub action, see [QtVsPlayermga8wally.spec](https://github.com/surfzoid/QtVsPlayer/blob/main/QtVsPlayermga8wally.spec#L138) for change log"
windoze:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
env:
CC: gcc
CXX: g++
Qt5_DIR: $GITHUB_WORKSPACE/qt/Qt/5.15.2/{arch}/bin
#QMAKESPEC: "%QTDIR%\/mkspecs\/win32-g++"
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MinGW",
os: windows-2019,
#artifact: "windows_mingw.7z",
#build_type: "Release",
cc: "gcc",
cxx: "g++",
#archiver: "7z a",
#generators: "Ninja"
}
steps:
- uses: actions/[email protected]
- name: Version
run: echo "::set-output name=version::$(head -n 1 ./QtVsPlayer.pro| cut -d ' ' -f 3)"
id: version
- name: Rel
run: echo "::set-output name=rel::$(grep "%global Rel" ./QtVsPlayermga8wally.spec | cut -d ' ' -f 3)"
id: rel
- name: Update Version and Release
run: |
sed -i 's/\(VERSION = \).*/\1 ${{ steps.version.outputs.version }}/' QtVsPlayer.pro
sed -i 's/\(RELEASE = \).*/\1 ${{ steps.Rel.outputs.rel }}/' QtVsPlayer.pro
- name: Check Version
run: echo ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
- name: Install Qt
uses: jurplel/[email protected]
with:
version: '5.15.2'
#host: 'windows'
#target: 'desktop'
dir: 'qt'
arch: 'win64_mingw81'
tools: 'tools_qtcreator,qt.tools.qtcreator'
- name: Install QT IFW (Windows)
if: runner.os == 'Windows'
run: |
python -m aqt install-tool windows desktop tools_ifw --outputdir C:/Qt
echo "C:/Qt/Tools/QtInstallerFramework/4.6/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo $env:GITHUB_PATH
echo $env:PATH
- name: qmake
run: |
#setx QMAKESPEC="%QTDIR%\mkspecs\/win64-g++" /M
#qmake -Wnone -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
qmake -Wnone -spec win32-g++ "CONFIG+=release" "CONFIG+=qml_debug"
- name: make & install
run: |
#remove double return
#sed -i ':a;N;$!ba;s/\n\n/\n/g' Makefile.Release
#sed -i ':a;N;$!ba;s/-Wextra -Wextra/-Wextra/g' Makefile.Release
#cat Makefile.Release
#make --debug
make
#dir debug
#dir release
mkdir application
cp release/QtVsPlayer.exe application/
cp lib/w86_64/* application/
cp lib/w86_64/HCNetSDKCom/* application/HCNetSDKCom/
dir application/
cp install-win.md application/README.TXT
cp README.md application/
cp QtVsPlayer_fr_FR.qm application/
cp LICENSE application/LICENSE.txt
cp Licenses_playctrl_linux.txt application/
rm application/PlayCtrl.lib
qtenv2.bat
windeployqt application/QtVsPlayer.exe --debug --compiler-runtime --libdir application/
cp qt/Qt/5.15.2/mingw81_64/bin/libgcc_s_seh-1.dll application/
cp qt/Qt/5.15.2/mingw81_64/bin/libstdc++-6.dll application/
cp qt/Qt/5.15.2/mingw81_64/bin/libwinpthread-1.dll application/
Compress-Archive -Path application\* -DestinationPath QtVsPlayer-win64-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.zip
- name: Create windows setup
run: |
cp -r application/ windeploy/packages/com.surfzoid.QtVsPlayer/data/
mv windeploy/packages/com.surfzoid.QtVsPlayer/data/LICENSE.txt windeploy/packages/com.surfzoid.QtVsPlayer/meta
cd windeploy
C:/Qt/Tools/QtInstallerFramework/4.6/bin/binarycreator.exe -c config/config.xml -p packages -f QtVsPlayerSetup-win64-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }} --verbose
mv QtVsPlayerSetup-win64-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.exe ../
- name: Create Github Release
uses: ncipollo/[email protected]
id: create_release
with:
artifacts: "QtVsPlayer-win64-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.zip,QtVsPlayerSetup-win64*"
replacesArtifacts: true
token: ${{ github.TOKEN }}
allowUpdates: true
name: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
tag: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
body: "Automatic build from GitHub action, see [QtVsPlayermga8wally.spec](https://github.com/surfzoid/QtVsPlayer/blob/main/QtVsPlayermga8wally.spec#L138) for change log"
Mac:
# The type of runner that the job will run on
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CC: gcc
CXX: g++
Qt5_DIR: $GITHUB_WORKSPACE/qt/Qt/5.15.2/{arch}/bin
QT_PLUGIN_PATH: $GITHUB_WORKSPACE/qt/Qt/5.15.2/{arch}/plugins/
strategy:
matrix:
os: [macos-11, macos-12]
steps:
- uses: actions/[email protected]
- name: Version
run: echo "::set-output name=version::$(head -n 1 ./QtVsPlayer.pro| cut -d ' ' -f 3)"
id: version
- name: Rel
run: echo "::set-output name=rel::$(grep "%global Rel" ./QtVsPlayermga8wally.spec | cut -d ' ' -f 3)"
id: rel
- name: Update Version and Release
run: |
sed -ie 's/\(VERSION = \).*/\1 ${{ steps.version.outputs.version }}/' QtVsPlayer.pro
sed -ie 's/\(RELEASE = \).*/\1 ${{ steps.Rel.outputs.rel }}/' QtVsPlayer.pro
- name: MacVersion
run: echo "::set-output name=version::$(sw_vers -productVersion)"
id: MacVersion
- name: Check Version
run: echo ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
- name: py setup
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install wheel
- name: Install Qt
uses: jurplel/[email protected]
with:
version: '5.15.2'
dir: 'qt'
env:
PREFIX: ~/QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}/usr/share
INSTALL_ROOT: ~/QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}/usr/share
- name: qmake
run: |
PREFIX=~/QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}/usr/share; qmake -Wnone
- name: make
run: |
make
- name: make check
run: make check
- name: make install
run: |
cp lib/macX86_64/*.dylib qtvsplayer.app/Contents/MacOS/
install_name_tool -change /usr/local/lib/libSystemTranform.dylib qtvsplayer.app/Contents/MacOS/libSystemTransform.dylib qtvsplayer.app/Contents/MacOS/libHCNetSDK.dylib
install_name_tool -change /usr/local/lib/libSystemTranform.dylib qtvsplayer.app/Contents/MacOS/libSystemTransform.dylib qtvsplayer.app/Contents/MacOS/QtVsPlayer
#mkdir macbuild
#mv qtvsplayer.app macbuild/
#cd macbuild/
pkgbuild --root ./qtvsplayer.app --version ${{ steps.version.outputs.version }} --identifier com.github.QtVsPlayer.app --install-location /Applications QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.pkg
macdeployqt "QtVsPlayer.app" -dmg -always-overwrite -no-plugins
mv QtVsPlayer.dmg QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.dmg
tar -czf QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.tgz qtvsplayer.app
- name: Create Github Release
uses: ncipollo/[email protected]
id: create_release
with:
artifacts: "QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.pkg,QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.tgz,QtVsPlayer-mac64-${{ steps.MacVersion.outputs.version }}-${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}.dmg"
replacesArtifacts: true
token: ${{ github.TOKEN }}
allowUpdates: true
name: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
tag: ${{ steps.version.outputs.version }}-${{ steps.Rel.outputs.rel }}
body: "Automatic build from GitHub action, see [QtVsPlayermga8wally.spec](https://github.com/surfzoid/QtVsPlayer/blob/main/QtVsPlayermga8wally.spec#L138) for change log"