-
-
Notifications
You must be signed in to change notification settings - Fork 32
1119 lines (1095 loc) · 47.3 KB
/
build.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
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: Build
# TODO: nuget, vcpkg on macOS, $(brew --prefix llvm)/bin/clang (llvm11), llvm12 is default
# https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry
on:
push:
schedule:
- cron: '0 12 * * 0'
repository_dispatch:
env:
FF_VER: master
LLVM_VER: ${{ vars.LLVM_VER }}
VC_LTL_VER: ${{ vars.VC_LTL_VER }}
NINJA_STATUS: '[%f/%t %e %r]'
SF_PW: ${{ secrets.SF_PW }}
SF_USER: ${{ secrets.SF_USER }}
SF_UPLOAD: ${{ github.event_name != 'repository_dispatch' || github.event.client_payload.ref == 'master' }}
NVJP2K_SDK_PW: ${{ secrets.NVJP2K_SDK_PW }}
CUDA_SDK_PW: ${{ secrets.CUDA_SDK_PW }}
jobs:
macOS:
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
runs-on: macos-15 # 15. 1 xcode per image
env:
TARGET_OS: 'macOS'
TARGET_ARCH: ${{ matrix.arch }}
LTO_SUFFIX: -lto
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
arch: [x86_64, arm64] # different minos
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }} # https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_dispatch
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
#- name: Setup Xcode
# run: sudo xcode-select -s /Applications/Xcode_${{ vars.XCODE }}.app
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: |
./mdk/external
!./mdk/external/lib/macOS/libvulkan.tbd
!./mdk/external/lib/libdav1d.tbd
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
# why may failed to cache/restore /usr/local/bin/sshpass?
# no build cache because build dir content changes but key should not, then no cache save.
- name: Create Build Environment
shell: bash
env:
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- name: Configure CMake
if: ${{ matrix.arch == 'x86_64' }}
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: mdk # TODO: remove
run: |
pwd
cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_X11=0 -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -GNinja -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk
- name: Configure CMake
if: ${{ startsWith(matrix.arch, 'arm64') }} # arm64, arm64e
shell: bash
working-directory: mdk
run: |
cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_X11=0 -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -GNinja -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk
- name: Build
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS} --parallel
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk*.tar.xz ../mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.arch }}.tar.xz
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.arch}}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.arch}}.tar.xz
- name: Upload to SourceForge
if: ${{ matrix.config == 'RelWithDebInfo' && matrix.arch == 'x86_64' && env.SF_UPLOAD == 'true' }}
shell: bash
run: |
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}-${{ matrix.arch }}.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
iOS:
runs-on: macos-latest
env:
TARGET_OS: ${{ matrix.os }}${{ matrix.simulator }}
LTO_SUFFIX: -lto
strategy:
fail-fast: false
matrix:
os: [iOS, tvOS, visionOS, macCatalyst]
config: [MinSizeRel]
simulator: ['', Simulator]
exclude:
- os: macCatalyst
simulator: Simulator
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: Setup Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ vars.XCODE }}.app
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: |
./mdk/external
!./mdk/external/lib/macOS/libvulkan.tbd
!./mdk/external/lib/libdav1d.tbd
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
# why may failed to cache/restore /usr/local/bin/sshpass?
# no build cache because build dir content changes but key should not, then no cache save.
- name: Create Build Environment
shell: bash
env:
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- name: Configure CMake
if: ${{ matrix.os != 'macCatalyst' }}
shell: bash
working-directory: mdk
run: |
minver=8.0
[[ "$TARGET_OS" == "tv"* ]] && minver=10.2 # VT: 10.2+
[[ "$TARGET_OS" == "vision"* ]] && minver=1.0
archs=arm64
[[ "$TARGET_OS" == *"Simulator" ]] && {
archs="arm64;x86_64"
sdk=$TARGET_OS
sdk=${sdk/iOSS/iphones}
sdk=${sdk/tvOSS/appletvs}
sdk=${sdk/visionOSS/xrs}
sdk=${sdk/xrOSS/xrs}
EXTRA_OPTS="-DCMAKE_OSX_SYSROOT=${sdk}"
}
[ ${{ matrix.os }} == visionOS ] && archs=arm64
cmake -GNinja -DFFMPEG_EMBED=1 -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_DEB_INFO=1 -DCMAKE_SYSTEM_NAME=${{ matrix.os }} $EXTRA_OPTS -DCMAKE_OSX_DEPLOYMENT_TARGET=$minver -DCMAKE_OSX_ARCHITECTURES="$archs" -Bbuild/${TARGET_OS} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_IOS_INSTALL_COMBINED=YES -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO # FFMPEG_EMBED=0 to copy libffmpeg.5.dylib
- name: Configure CMake
if: ${{ matrix.os == 'macCatalyst' }}
shell: bash
working-directory: mdk
run: cmake -GNinja -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/macCatalyst.cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk
- name: Build
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS} --parallel
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk*.tar.xz ..
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}.tar.xz
- name: Upload to SourceForge
if: ${{ env.SF_UPLOAD == 'true' }}
shell: bash
run: sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
Apple:
runs-on: macos-latest
needs: [macOS, iOS]
steps:
- name: Setup Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ vars.XCODE }}.app
- uses: actions/checkout@v4
- name: Download macOS x64 sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-macOS-x86_64-MinSizeRel
- name: Download macOS arm64 sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-macOS-arm64-MinSizeRel
- name: Download iOS sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-iOS-MinSizeRel
- name: Download iOSSimulator sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-iOSSimulator-MinSizeRel
- name: Download tvOS sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-tvOS-MinSizeRel
- name: Download tvOSSimulator sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-tvOSSimulator-MinSizeRel
- name: Download visionOS sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-visionOS-MinSizeRel
- name: Download visionOSSimulator sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-visionOSSimulator-MinSizeRel
- name: Download macCatalyst sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-macCatalyst-MinSizeRel
- name: Install tools
shell: bash
run: brew install hudochenkov/sshpass/sshpass
- name: make XCFramework and SDK
shell: bash
run: |
export XZ_OPT="-9e -T0"
mkdir -p macOS iOS iOSSimulator tvOS tvOSSimulator visionOS visionOSSimulator macCatalyst mdk-sdk/{Frameworks,include,lib} macOS-arm64 macOS-x86_64
tar Jxf mdk-sdk-macOS-x86_64.tar.xz -C macOS-x86_64
tar Jxf mdk-sdk-macOS-arm64.tar.xz -C macOS-arm64
tar Jxf mdk-sdk-iOS.tar.xz -C iOS
tar Jxf mdk-sdk-iOSSimulator.tar.xz -C iOSSimulator
tar Jxf mdk-sdk-tvOS.tar.xz -C tvOS
tar Jxf mdk-sdk-tvOSSimulator.tar.xz -C tvOSSimulator
tar Jxf mdk-sdk-visionOS.tar.xz -C visionOS
tar Jxf mdk-sdk-visionOSSimulator.tar.xz -C visionOSSimulator
tar Jxf mdk-sdk-macCatalyst.tar.xz -C macCatalyst
find .
cp -af macOS-$(uname -m)/mdk-sdk macOS/ # libffmpeg is already fat
lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework/mdk -output macOS/mdk-sdk/lib/mdk.framework/Versions/Current/mdk
lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework.dSYM/Contents/Resources/DWARF/mdk -output macOS/mdk-sdk/lib/mdk.framework.dSYM/Contents/Resources/DWARF/mdk
if [ -f macOS-arm64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib -a -f macOS-x86_64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib ]; then
lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib -output macOS/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib
fi
if [ -f macOS-arm64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib -a -f macOS-x86_64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib ]; then
lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib -output macOS/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib
fi
for b in `ls macOS-arm64/mdk-sdk/bin`; do # exes exist in both archs
if [ -f macOS-x86_64/mdk-sdk/bin/$b ]; then
lipo -create macOS-{arm,x86_}64/mdk-sdk/bin/$b -output macOS/mdk-sdk/bin/$b
fi
done
codesign --force --sign - --deep --timestamp macOS/mdk-sdk/lib/mdk.framework
libffmpeg=$(find macCatalyst/mdk-sdk/lib/mdk.framework -name "libffmpeg*.dylib")
# xcrun bitcode_strip -r $libffmpeg -o $libffmpeg
# xcrun bitcode_strip -r macCatalyst/mdk-sdk/lib/mdk.framework/mdk -o macCatalyst/mdk-sdk/lib/mdk.framework/Versions/Current/mdk
cp -af macOS/mdk-sdk/{bin,doc,*.sh} mdk-sdk
cp -af macOS/mdk-sdk/README.md mdk-sdk/README-macOS.md
cp -af macOS/mdk-sdk/lib/cmake mdk-sdk/lib/
cp -af iOS/mdk-sdk/README.md mdk-sdk/README-iOS.md
# https://developer.apple.com/forums/thread/655768 (error: the path does not point to a valid debug symbols file: macOS/mdk-sdk/lib/mdk.framework.dSYM)
xcodebuild -create-xcframework -framework macOS/mdk-sdk/lib/mdk.framework -debug-symbols $PWD/macOS/mdk-sdk/lib/mdk.framework.dSYM -framework iOS/mdk-sdk/lib/mdk.framework -debug-symbols $PWD/iOS/mdk-sdk/lib/mdk.framework.dSYM -framework iOSSimulator/mdk-sdk/lib/mdk.framework -framework tvOS/mdk-sdk/lib/mdk.framework -framework tvOSSimulator/mdk-sdk/lib/mdk.framework -framework visionOS/mdk-sdk/lib/mdk.framework -framework visionOSSimulator/mdk-sdk/lib/mdk.framework -framework macCatalyst/mdk-sdk/lib/mdk.framework -output mdk-sdk/lib/mdk.xcframework
mdkfw=`find mdk-sdk/lib/mdk.xcframework -name "macos-*" -depth 1`
# ensure bin/* can Find mdk and ffmpeg
ln -sf ${mdkfw/mdk-sdk/..}/mdk.framework mdk-sdk/Frameworks
ln -sf ../Frameworks/mdk.framework/Headers mdk-sdk/include/mdk
codesign --force --sign - --deep --timestamp mdk-sdk/lib/mdk.xcframework
# pod requires a file in tarball
gtar Jcvf mdk-sdk-apple.tar.xz mdk-sdk README.md
gtar Jcvf mdk-sdk-macOS.tar.xz -C macOS .
7z a mdk-sdk-apple.zip mdk-sdk
swift package compute-checksum mdk-sdk-apple.zip
- name: Archieve XCFramework SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-apple
path: mdk-sdk-apple.tar.xz
- name: Archieve macOS SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-macOS
path: mdk-sdk-macOS.tar.xz
- name: Upload to SourceForge
if: ${{ env.SF_UPLOAD == 'true' }}
shell: bash
run: |
make -f upload.mk
Windows:
runs-on: windows-latest
env:
TARGET_OS: windows-desktop
strategy:
fail-fast: false
matrix:
config: [RelWithDebInfo]
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
- name: Create Build Environment
shell: bash
env:
SYSROOT_CACHE_HIT: true
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
- name: Configure for win arm64
env:
ARCH: arm64
working-directory: mdk
run: cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win arm64
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-arm64
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
- name: Configure for win x86
env:
ARCH: x86
R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
working-directory: mdk
run: cmake -DR3DSDK=${{ env.R3DSDK }} -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win x86
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-x86
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Get nvJPEG2000 SDK
shell: bash
run: |
curl -kL -o nvjpeg2000.zip https://github.com/user-attachments/files/17663661/nvjpeg2000.zip
7z x -y -p${{ env.NVJP2K_SDK_PW }} nvjpeg2000.zip
curl -kL -o cuda.zip https://github.com/user-attachments/files/17663668/cuda.zip
7z x -y -p${{ env.CUDA_SDK_PW }} cuda.zip
- name: Configure for win x64
env:
ARCH: x64
R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
working-directory: mdk
run: cmake -DR3DSDK=${{ env.R3DSDK }} -DNVJP2K=1 -DCUDA_SDK_DIR=${{ github.workspace }}/cuda -DNVJPEG2K_PATH=${{ github.workspace }}/nvjpeg2000 -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win x64
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-x64
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}-vs2022.7z
rm -rf mdk-sdk/bin/{x86,arm*}
7z a -ssc -m0=lzma2 -mx=9 -ms=on -mf=off ../mdk-sdk-${{ env.TARGET_OS }}-vs2022-x64.7z mdk-sdk
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-vs2022-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}-vs2022*.7z
# - name: Upload to SourceForge
# if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
# uses: garygrossgarten/github-action-scp@release
# with:
# host: 'frs.sourceforge.net'
# username: ${{ secrets.SF_USER }}
# password: ${{ secrets.SF_PW }}
# local: mdk-sdk-${{ env.TARGET_OS }}-vs2022.7z
# remote: '/home/frs/project/mdk-sdk/nightly/'
Win64_SRC:
if: false
runs-on: windows-latest
env:
TARGET_OS: windows-desktop
ARCH: x64
strategy:
fail-fast: false
matrix:
config: [Debug]
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
- name: Create Build Environment
shell: bash
env:
SYSROOT_CACHE_HIT: true
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Configure for win x64
env:
R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
working-directory: mdk
run: cmake -DSOURCE_MODULES=core -DR3DSDK=${{ env.R3DSDK }} -DUSE_LTO=0 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win x64
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-x64
- name: Install for win x64
working-directory: mdk
run: cmake --install build/${{ env.TARGET_OS }}-x64
- name: Make SRC SDK
shell: bash
working-directory: mdk
run: |
chmod +x ../mksrc.sh
../mksrc.sh $PWD mdk-sdk-${{ env.ARCH }}
cp -avf ../CMakeLists.txt mdk-sdk-${{ env.ARCH }}
if [[ ${{ matrix.config }} == Debug ]]; then
CRT_SUFFIX=d
fi
cp -avf external/lib/windows/${{ env.ARCH }}/MD$CRT_SUFFIX/{vpl,snappy}.lib mdk-sdk-${{ env.ARCH }}/lib
date +%m%d
7z a -p${{ secrets.SRC_USER }}`date +%m%d` -mhe ../mdk-src-${{ env.TARGET_OS }}-vs2022.7z mdk-sdk-${{ env.ARCH }}
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-src-vs2022-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-src-${{ env.TARGET_OS }}-vs2022.7z
Windows_LTL:
runs-on: windows-latest
env:
TARGET_OS: windows-desktop
CRT_EXTRA: LTL
strategy:
fail-fast: false
matrix:
config: [RelWithDebInfo]
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-${{ env.CRT_EXTRA }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
- name: 'Restore VC-LTL cache'
id: ltl-cache
uses: actions/cache@v4
with:
path: ./mdk/cmake/VC-LTL
key: ltl-${{ vars.VC_LTL_VER }}
- if: ${{ steps.ltl-cache.outputs.cache-hit != 'true' }}
name: Get VC-LTL
shell: bash
working-directory: mdk/cmake
run: |
curl -kL -o ltl.7z https://github.com/Chuyu-Team/VC-LTL5/releases/download/v${VC_LTL_VER}/VC-LTL-${VC_LTL_VER}-Binary.7z
7z x ltl.7z -oVC-LTL
- name: Create Build Environment
shell: bash
env:
SYSROOT_CACHE_HIT: true
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
- name: Configure for win x86
env:
ARCH: x86
R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
working-directory: mdk
run: cmake -DVC_LTL=1 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DR3DSDK=${{ env.R3DSDK }} -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win x86
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-x86
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Configure for win x64
env:
ARCH: x64
R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
working-directory: mdk
run: cmake -DVC_LTL=1 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DR3DSDK=${{ env.R3DSDK }} -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win x64
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-x64
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}-vs2022-ltl.7z
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-vs2022-ltl-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}-vs2022-ltl.7z
UWP:
runs-on: windows-latest
env:
TARGET_OS: uwp
strategy:
fail-fast: false
matrix:
config: [RelWithDebInfo]
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
- name: Create Build Environment
shell: bash
env:
SYSROOT_CACHE_HIT: true
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
uwp: true
- name: Configure for uwp arm64
env:
ARCH: arm64
working-directory: mdk
run: cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -GNinja -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win arm64
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-arm64
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
uwp: true
- name: Configure for uwp x64
env:
ARCH: x64
working-directory: mdk
run: cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -GNinja -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
- name: Build for win x64
working-directory: mdk
run: cmake --build build/${{ env.TARGET_OS }}-x64
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}-vs2022.7z
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-vs2022-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}-vs2022.7z
ClangCL:
runs-on: ubuntu-latest
env:
TARGET_OS: ${{ matrix.os }}
VCDIR: '/tmp/winsysroot/msvcrt-dev'
WINDOWSSDKDIR: '/tmp/winsysroot/winsdk'
strategy:
fail-fast: false
matrix:
os: [windows-desktop]
config: [MinSizeRel]
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v4
with:
path: /tmp/winsysroot
key: sysroot-${{ env.TARGET_OS }}${{ vars.WINSDKVER }}-vc${{ vars.VCVER }}
- name: Create Build Environment
shell: bash
env:
SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- name: Configure for win arm64
env:
ARCH: arm64
working-directory: mdk
run: |
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
cmake -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/windows.clang.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for arm64
working-directory: mdk
run: cmake --build build/${TARGET_OS}-arm64
- name: Configure for win x86
env:
ARCH: x86
working-directory: mdk
run: |
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
cmake -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/windows.clang.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for x86
working-directory: mdk
run: cmake --build build/${TARGET_OS}-x86
- name: Configure for win x64
env:
ARCH: x64
working-directory: mdk
run: |
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
cmake -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/windows.clang.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for x64
working-directory: mdk
run: cmake --build build/${TARGET_OS}-x64
- name: Make SDK
working-directory: mdk
run: |
../ci-after-build.sh
if [ -f $VCDIR/bin/x64/vcruntime140_1.dll ]; then
mkdir -p mdk-sdk/bin/x64
cp $VCDIR/bin/x64/vcruntime140_1.dll mdk-sdk/bin/x64
7z a mdk-sdk-*.7z mdk-sdk/bin/x64/vcruntime140_1.dll
fi
mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}-clang.7z
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-clang-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}-clang.7z
- name: Upload to SourceForge
if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
run: sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}-clang.7z ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
NuGet:
runs-on: ubuntu-latest
needs: [Windows, UWP, Windows_LTL]
steps:
- uses: actions/checkout@v4
- name: Download win32 vs2022 sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-vs2022-windows-desktop-RelWithDebInfo
- name: Download win32 vs2022 ltl sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-vs2022-ltl-windows-desktop-RelWithDebInfo
- name: Download uwp vs2022 sdk
uses: actions/download-artifact@v4
with:
name: mdk-sdk-vs2022-uwp-RelWithDebInfo
- name: update build version
shell: bash
run: sed -i "s,\(.*\.\)[0-9]*\(</version>\),\1${GITHUB_RUN_NUMBER}\2," nuget/mdk.nuspec
- name: Make nupkg (VS2022)
run: |
rm -rf mdk-sdk uwp
md5sum mdk-sdk-windows-desktop-vs2022.7z | cut -d ' ' -f1 > mdk-sdk-windows-desktop-vs2022.7z.md5
md5sum mdk-sdk-windows-desktop-vs2022-x64.7z | cut -d ' ' -f1 > mdk-sdk-windows-desktop-vs2022-x64.7z.md5
7z x mdk-sdk-windows-desktop-vs2022.7z
7z x mdk-sdk-uwp-vs2022.7z -o"uwp"
mkdir mdk-sdk/bin/UAP
cp -af uwp/mdk-sdk/bin/* mdk-sdk/bin/UAP
cp nuget/mdk.nuspec mdk-sdk
cp -avf nuget/README.md mdk-sdk
cd mdk-sdk
nuget pack mdk.nuspec
mv *.nupkg ../mdk-vs2022.nupkg
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-nuget
path: 'mdk*.nupkg'
- name: Upload to SourceForge
if: ${{ env.SF_UPLOAD == 'true' }}
shell: bash
run: |
sudo apt update
sudo apt install -y sshpass
make -f upload.mk
Linux:
runs-on: ubuntu-latest
env:
TARGET_OS: linux
LTO_SUFFIX: -lto
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v4
with:
path: ./mdk/sysroot
key: sysroot-${{ env.TARGET_OS }}-${{ vars.LINUX_SYSROOT_ID }}
- name: Create Build Environment
shell: bash
env:
SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
../ci-before-build.sh
- name: Configure for x64
env:
ARCH: amd64
shell: bash
working-directory: mdk
run: cmake -DR3DSDK=$PWD/external/R3DSDK -DGLVA_STATIC_CXX=OFF -DUSE_LTO=1 -DUSE_LIBCXX=1 -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for x64
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-amd64
- name: Configure for aarch64
env:
ARCH: arm64
shell: bash
working-directory: mdk
run: cmake -DGLVA_STATIC_CXX=OFF -DUSE_LTO=1 -DUSE_LIBCXX=1 -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for aarch64
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-arm64
- name: Configure for armhf
env:
ARCH: armhf
shell: bash
working-directory: mdk
run: cmake -DGLVA_STATIC_CXX=OFF -DUSE_LTO=1 -DUSE_LIBCXX=1 -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for armhf
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-armhf
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk*.tar.xz ..
rm -rf mdk-sdk/{bin,lib}/arm*
tar Jcvf ../mdk-sdk-${{ env.TARGET_OS }}-x64.tar.xz mdk-sdk
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}*.tar.xz
- name: Upload to SourceForge
if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
shell: bash
run: |
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}-x64.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
md5sum mdk-sdk-${TARGET_OS}.tar.xz | cut -d ' ' -f1 > mdk-sdk-${TARGET_OS}.tar.xz.md5
md5sum mdk-sdk-${TARGET_OS}-x64.tar.xz | cut -d ' ' -f1 > mdk-sdk-${TARGET_OS}-x64.tar.xz.md5
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-*.md5 ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
Android:
runs-on: ubuntu-latest # ndk 25 removed
env:
#FF_VER: 6.1 # 7.0 and master is very slow in avformat_find_stream_info
TARGET_OS: android
LTO_SUFFIX: -lto
MIN_API: 21
NDK_32: r25c
strategy:
fail-fast: false
matrix:
config: [MinSizeRel] # https://github.com/android/ndk/issues/721
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v4
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
- name: Create Build Environment
shell: bash
env:
# SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
- name: Configure for arm64-v8a
env:
ARCH: arm64-v8a
shell: bash
working-directory: mdk
run: |
ls ${ANDROID_HOME}/ndk
MIN_API_64=21
[ $MIN_API -gt 21 ] && MIN_API_64=$MIN_API
cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API_64} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for arm64-v8a
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-arm64-v8a
- name: Configure for x86_64
env:
ARCH: x86_64
shell: bash
working-directory: mdk
run: |
MIN_API_64=21
[ $MIN_API -gt 21 ] && MIN_API_64=$MIN_API
cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API_64} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for x86_64
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-x86_64
# - uses: nttld/setup-ndk@v1
# id: setup-ndk
# with:
# ndk-version: ${{ env.NDK_32 }}
# local-cache: false
# - name: 'Restore ndk cache' # setup-ndk not fully cached
# id: ndk-cache
# uses: actions/cache@v4
# with:
# path: ${{ runner.tool_cache }}/ndk/${{ env.NDK_32 }} # /opt/hostedtoolcache
# key: ndk-cache-${{ runner.os }}-${{ env.NDK_32 }}
- name: Configure for armeabi-v7a
env:
ARCH: armeabi-v7a
MIN_API: 21 # 19: android 4.4. ndk25
# ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
shell: bash
working-directory: mdk
run: cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for armeabi-v7a
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-armeabi-v7a
- name: Configure for x86
env:
ARCH: x86
MIN_API: 21 # 19: android 4.4. ndk25
# ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
shell: bash
working-directory: mdk
run: cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build for x86
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-x86
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk-*.7z ..
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}.7z
- name: Upload to SourceForge
if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
shell: bash
run: |
7z d -ssc -m0=lzma2 -mx=9 -ms=on -mf=off mdk-sdk-${TARGET_OS}.7z mdk-sdk/lib/{x86,x86_64}/libmdk.so.dsym
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.7z ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk/build/android-arm64-v8a/video/libqtav-mediacodec.so ${SF_USER}@frs.sourceforge.net:/home/frs/project/qtav/depends/mediacodec/arm64-v8a
md5sum mdk-sdk-${TARGET_OS}.7z | cut -d ' ' -f1 > mdk-sdk-${TARGET_OS}.7z.md5
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-*.md5 ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
abi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/mdk
path: mdk
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
- name: Make SDK
shell: bash
run: |
mkdir -p mdk-sdk/include/abi/mdk
cp -avf mdk/include/mdk/{AudioFormat,AudioFrame,Buffer,ColorSpace,FrameReader,global,MediaInfo,Property,VideoBuffer,VideoFormat,VideoFrame,VideoDecoder,Packet,MediaIO}.h mdk-sdk/include/abi/mdk
- name: Archieve SDK
uses: actions/upload-artifact@v4
with:
name: mdk-abi-sdk
path: mdk-sdk/