Skip to content

[2e4cf520] framereader: fix next decoder #1067

[2e4cf520] framereader: fix next decoder

[2e4cf520] framereader: fix next decoder #1067

Workflow file for this run

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
# 7z => cmake -E tar xvf/cvf --format=7zip
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 }}
jobs:
macOS:
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
runs-on: macos-latest
env:
TARGET_OS: 'macOS'
TARGET_ARCH: ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master # TODO: dispatch ref
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
# - name: Setup Xcode
# run: sudo xcode-select -s /Applications/Xcode_12.4.app
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
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 }}-dav1d${{ vars.DAV1D_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:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-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 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
run: |
pwd
cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_X11=1 -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -GNinja -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk # no dSYM for lto, dsymutil: no debug symbols in executable (-arch x86_64)
- name: Configure CMake
if: ${{ startsWith(matrix.arch, 'arm64') }} # arm64, arm64e
shell: bash
working-directory: mdk
run: |
cmake -DMIN_SIZE=1 -DUSE_LTO=1 -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 # no dSYM for lto, dsymutil: no debug symbols in executable (-arch x86_64)
- name: Build
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}
- 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@v3
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' }}
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/
macCatalyst:
runs-on: macos-latest
env:
TARGET_OS: 'macCatalyst'
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
# - name: Setup Xcode
# run: sudo xcode-select -s /Applications/Xcode_12.4.app
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: |
./mdk/external
!./mdk/external/lib/libdav1d.tbd
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_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:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-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 CMake
# 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
run: cmake -GNinja -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/macCatalyst.cmake -DUSE_BITCODE=0 -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk # no dSYM for lto, dsymutil: no debug symbols in executable (-arch x86_64)
- name: Build
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk*.tar.xz ../mdk-sdk-${{ env.TARGET_OS }}.tar.xz
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}.tar.xz
- name: Upload to SourceForge
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/
iOS:
runs-on: macos-latest
env:
TARGET_OS: iOS
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
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 }}-dav1d${{ vars.DAV1D_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:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-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 CMake
shell: bash
working-directory: mdk
run: cmake -GNinja -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_DEB_INFO=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/ios.cmake -DIOS_DEPLOYMENT_TARGET=8.0 -DIOS_ARCH="arm64" -DIOS_BITCODE=0 -Bbuild/${TARGET_OS} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk -DCMAKE_VERBOSE_MAKEFILE=1 -DFFMPEG_EMBED=1 # FFMPEG_EMBED=0 to copy libffmpeg.5.dylib
- name: Build
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}
- name: Make SDK
shell: bash
working-directory: mdk
run: |
cmake -P build/${TARGET_OS}/cmake_install.cmake
../mksdk.sh mdk-sdk || echo done
libffmpeg=$(find mdk-sdk/lib/mdk.framework -name "libffmpeg*.dylib")
if [ -f "$libffmpeg" ]; then
lipo -thin arm64 "$libffmpeg" -output "$libffmpeg"
fi
libass=$(find mdk-sdk/lib/mdk.framework -name "libass*.dylib")
if [ -f "$libass" ]; then
lipo -thin arm64 "$libass" -output "$libass"
fi
gtar Jcfv mdk-sdk-$TARGET_OS.tar.xz mdk-sdk
mv mdk-sdk*.tar.xz ..
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}.tar.xz
- name: Upload to SourceForge
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/
iOSSimulator:
runs-on: macos-latest
env:
TARGET_OS: iOSSimulator
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
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 }}-dav1d${{ vars.DAV1D_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:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-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 CMake
shell: bash
working-directory: mdk
run: cmake -GNinja -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_DEB_INFO=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET=8.0 -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO -DCMAKE_IOS_INSTALL_COMBINED=YES -DCMAKE_OSX_SYSROOT=iphonesimulator -Bbuild/${TARGET_OS} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk -DCMAKE_VERBOSE_MAKEFILE=1 -DFFMPEG_EMBED=1 # FFMPEG_EMBED=0 to copy libffmpeg.5.dylib
- name: Build
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}
- name: Make SDK
shell: bash
working-directory: mdk
run: |
cmake -P build/${TARGET_OS}/cmake_install.cmake
../mksdk.sh mdk-sdk || echo done
libffmpeg=$(find mdk-sdk/lib/mdk.framework -name "libffmpeg*.dylib")
if [ -f "$libffmpeg" ]; then
lipo -thin x86_64 "$libffmpeg" -output "$libffmpeg"
fi
libass=$(find mdk-sdk/lib/mdk.framework -name "libass*.dylib")
if [ -f "$libass" ]; then
lipo -thin x86_64 "$libass" -output "$libass"
fi
gtar Jcfv mdk-sdk-$TARGET_OS.tar.xz mdk-sdk
mv mdk-sdk*.tar.xz ..
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}.tar.xz
Apple:
runs-on: macos-latest
needs: [macOS, iOS, iOSSimulator, macCatalyst]
steps:
- uses: actions/checkout@v3
- name: Download macOS sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-macOS-x86_64-MinSizeRel
- name: Download macOS sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-macOS-arm64-MinSizeRel
- name: Download iOS sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-iOS-MinSizeRel
- name: Download iOSSimulator sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-iOSSimulator-MinSizeRel
- name: Download macCatalyst sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-macCatalyst-MinSizeRel
- name: Install tools
shell: bash
run: brew install p7zip gnu-tar hudochenkov/sshpass/sshpass
- name: make XCFramework and SDK
shell: bash
run: |
export XZ_OPT="-9e -T0"
mkdir -p macOS iOS iOSSimulator 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-macCatalyst.tar.xz -C macCatalyst
find .
cp -af macOS-x86_64/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
lipo -create macOS-{arm,x86_}64/mdk-sdk/bin/$b -output macOS/mdk-sdk/bin/$b
done
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 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
# 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 .
- name: Archieve XCFramework SDK
uses: actions/upload-artifact@v3
with:
name: mdk-sdk-apple
path: mdk-sdk-apple.tar.xz
- name: Archieve macOS SDK
uses: actions/upload-artifact@v3
with:
name: mdk-sdk-macOS
path: mdk-sdk-macOS.tar.xz
- name: Upload to SourceForge
shell: bash
run: |
make -f upload.mk
Legacy_RaspberryPi_libcxx:
if: false # FIXME: std::to_array undeclared if use clang-16 + sysroot libc++8, linux build is fine
runs-on: ubuntu-latest
env:
FF_VER: 5.1 # master build error
TARGET_OS: 'raspberry-pi'
LTO_SUFFIX: -lto
#LLVM_VER: 8
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: ./mdk/sysroot
key: sysroot-${{ env.TARGET_OS }}-${{ vars.RPI_SYSROOT_ID }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
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 CMake
shell: bash
working-directory: mdk
run: |
pwd
cmake -DUSE_LTO=thin -DCMAKE_C_COMPILER=clang-${LLVM_VER:-17} -DCMAKE_CXX_COMPILER=clang++-${LLVM_VER:-17} -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} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}
- 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@v3
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' }}
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/
Windows_VS2022:
runs-on: windows-latest
env:
TARGET_OS: windows-desktop
strategy:
fail-fast: false
matrix:
config: [RelWithDebInfo]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_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: Configure for win x64
env:
ARCH: x64
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 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@v3
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' }}
# 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:
runs-on: windows-latest
env:
TARGET_OS: windows-desktop
ARCH: x64
strategy:
fail-fast: false
matrix:
config: [RelWithDebInfo,Debug]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_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@v3
with:
name: mdk-src-vs2022-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-src-${{ env.TARGET_OS }}-vs2022.7z
Windows_VS2022_LTL:
runs-on: windows-latest
env:
TARGET_OS: windows-desktop
CRT_EXTRA: LTL
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-${{ env.CRT_EXTRA }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore VC-LTL cache'
id: ltl-cache
uses: actions/cache@v3
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 }} -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 }} -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@v3
with:
name: mdk-sdk-vs2022-ltl-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}-vs2022-ltl.7z
UWP_VS2022:
runs-on: windows-latest
env:
TARGET_OS: uwp
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_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 -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 -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@v3
with:
name: mdk-sdk-vs2022-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}-vs2022.7z
Windows_clang:
runs-on: ubuntu-latest
env:
TARGET_OS: windows-desktop
VCDIR: '/tmp/winsysroot/msvcrt-dev'
WINDOWSSDKDIR: '/tmp/winsysroot/winsdk'
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: /tmp/winsysroot
key: sysroot-${{ env.TARGET_OS }}${{ vars.WINSDKVER }}-vc${{ vars.VCVER }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
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 win arm64
shell: bash
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
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-arm64
- name: Configure for win x86
shell: bash
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
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-x86
- name: Configure for win x64
shell: bash
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
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-x64
- name: Make SDK
shell: bash
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@v3
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' }}
shell: bash
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/
UWP_clang:
if: false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
env:
TARGET_OS: uwp
VCDIR: '/tmp/winsysroot/msvcrt-dev'
WINDOWSSDKDIR: '/tmp/winsysroot/winsdk'
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: /tmp/winsysroot
key: sysroot-${{ env.TARGET_OS }}${{ vars.WINSDKVER }}-vc${{ vars.VCVER }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
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 UWP arm
if: ${{ matrix.config == 'Release' || matrix.config == 'MinSizeRel' }}
shell: bash
env:
ARCH: arm
working-directory: mdk
run: |
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
# MinSizeRel/Release instead of RelWithDebInfo because win arm debug is not supported in clang
cmake -DWITH_DEB_INFO=0 -DUWP=1 -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 UWP arm
if: ${{ matrix.config == 'Release' || matrix.config == 'MinSizeRel' }}
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-arm
- name: Configure for UWP arm64
shell: bash
env:
ARCH: arm64
working-directory: mdk
run: |
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
cmake -DUWP=1 -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 UWP arm64
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-arm64
- name: Configure for UWP x64
shell: bash
env:
ARCH: x64
working-directory: mdk
run: |
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
cmake -DUWP=1 -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 UWP x64
shell: bash
working-directory: mdk
run: cmake --build build/${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 }}-clang.7z
- name: Archieve SDK
uses: actions/upload-artifact@v3
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' }}
shell: bash
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_VS2022, UWP_VS2022]
steps:
- uses: actions/checkout@v3
- name: Download win32 vs2022 sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-vs2022-windows-desktop-RelWithDebInfo
- name: Download win32 vs2022 ltl sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-vs2022-ltl-windows-desktop-MinSizeRel
- name: Download uwp vs2022 sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-vs2022-uwp-MinSizeRel
- 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
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@v3
with:
name: mdk-nuget
path: 'mdk*.nupkg'
- name: Upload to SourceForge
shell: bash
run: |
sudo apt update
sudo apt install -y sshpass
for f in mdk-sdk-windows-desktop-vs2022-ltl.7z mdk-sdk-windows-desktop-vs2022*.7z mdk-sdk-uwp-vs2022.7z mdk-vs2022.nupkg; do
sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no $f ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
done
Linux_libcxx:
runs-on: ubuntu-latest
env:
TARGET_OS: linux
LTO_SUFFIX: -lto
strategy:
fail-fast: false
matrix:
config: [MinSizeRel]
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: ./mdk/sysroot
key: sysroot-${{ env.TARGET_OS }}-${{ vars.LINUX_SYSROOT_ID }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
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@v3
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' }}
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/
Android:
runs-on: ubuntu-latest
env:
TARGET_OS: android
LTO_SUFFIX: -lto
MIN_API: 19 # android 4.4. ndk25
strategy:
fail-fast: false
matrix:
config: [MinSizeRel] # https://github.com/android/ndk/issues/721
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
ref: master
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
- name: 'Restore External Dep cache'
id: external-dep-cache
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
# 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 armeabi-v7a
env:
ARCH: armeabi-v7a
# TODO: MIN_API: 19, ndk 25
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_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 armeabi-v7a
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-armeabi-v7a
- name: Configure for arm64-v8a
env:
ARCH: arm64-v8a
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 arm64-v8a
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-arm64-v8a
- name: Configure for x86
env:
ARCH: x86
# TODO: MIN_API: 16, ndk 25 $ANDROID_HOME/ndk/25.2.9519653 https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
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_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
shell: bash
working-directory: mdk
run: cmake --build build/${TARGET_OS}-x86
- 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
- name: Make SDK
shell: bash
working-directory: mdk
run: |
../ci-after-build.sh
mv mdk-sdk-*.7z ..
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
path: mdk-sdk-${{ env.TARGET_OS }}.7z
- name: Upload to SourceForge
if: ${{ matrix.config == 'MinSizeRel' }}
shell: bash
run: |
7z d -ssc -m0=lzma2 -mx=9 -ms=on -mf=off mdk-sdk-${TARGET_OS}.7z mdk-sdk/lib/{armeabi-v7a,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
abi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@v3
with:
repository: wang-bin/mdk
path: mdk
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,MediaIO}.h mdk-sdk/include/abi/mdk
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: mdk-abi-sdk
path: mdk-sdk/