Skip to content

ci: use llvm-17. update submodules #350

ci: use llvm-17. update submodules

ci: use llvm-17. update submodules #350

Workflow file for this run

name: Build
on:
push:
schedule:
- cron: '0 12 * * 0'
env:
# if: (github.event_name == 'schedule')
# GITHUB_ENV: https://docs.github.com/en/actions/learn-github-actions/environment-variables#about-environment-variables
FF_VERSION: ${{ vars.FF_VER }} # TODO: latest release if triggered by schedule
LLVM_VER: ${{ vars.LLVM_VER }}
LLVM_VER_DEFAULT: 17
NINJA_STATUS: '[%f/%t %e %r]'
SF_PW_MAPPED: ${{ secrets.SF_PW }}
SF_USER_MAPPED: ${{ secrets.SF_USER }}
VC_LTL_VER: 5.0.5
jobs:
Apple:
# 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: ${{ matrix.target }}
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [default,lite]
target: [macOS,iOS,iOSSimulator,macCatalyst]
exclude:
- config: default
target: iOSSimulator
- config: default
target: macCatalyst
steps:
- uses: actions/checkout@v3
- 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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
run: |
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
[ "${TARGET_OS}" = iOS ] && export USER_OPT="--enable-wolfssl"
./avbuild.sh ${TARGET_OS}
if [ "${TARGET_OS}" = iOS ]; then
find sdk-* -name "*.dylib" -delete
fi
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
Wasm:
runs-on: macos-latest
env:
TARGET_OS: 'wasm'
steps:
- uses: actions/checkout@v3
- 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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
shell: bash
run: |
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
./avbuild.sh ${TARGET_OS}
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}
path: ffmpeg-*.tar.xz
RaspberryPi_clang:
runs-on: ubuntu-latest
env:
TARGET_OS: 'raspberry-pi'
COMPILER: 'clang'
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [lite,lite-lto]
steps:
- uses: actions/checkout@v3
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: /tmp/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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
shell: bash
run: |
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
export SYSROOT=/tmp/sysroot
V=1 USE_TOOLCHAIN=clang-${LLVM_VER:-$LLVM_VER_DEFAULT} ./avbuild.sh ${TARGET_OS}
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
VS2022:
runs-on: windows-2022
env:
TARGET_OS: ${{ matrix.target }}
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [default,lite]
target: [windows-desktop,uwp]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
shell: cmd
run: |
set FF_BRANCH=%FF_VERSION%
if not [%FF_BRANCH%]==[master] set FF_BRANCH=release/%FF_VERSION%
git clone -b %FF_BRANCH% --depth 1 --no-tags https://git.ffmpeg.org/ffmpeg.git ffmpeg-%FF_VERSION%
if not [%CONFIG_SUFFIX%]==[-default] copy /y config%CONFIG_SUFFIX%.sh config.sh
- uses: msys2/setup-msys2@v2
with:
release: false # disable installation cache, so exe path in avbuild.sh is correct
msystem: MSYS
update: true
install: >-
make
diffutils
patch
pkg-config
nasm
yasm
- name: Install dev packages
shell: msys2 {0}
run: |
wget https://sourceforge.net/projects/avbuild/files/dep/dep.7z/download -O dep.7z
- name: Configure and Build
shell: cmd
run: |
7z x -y dep.7z -otools
set PKG_CONFIG_PATH_MFX=%CD%\tools\dep\VS2022\lib\pkgconfig
set MSYS2_DIR=C:\msys64
set HOME=%CD%
set FFSRC=%CD%\ffmpeg-%FF_VERSION%
set BUILD_NOW=true
tools\vcbuild.bat VS2022 %TARGET_OS%10 all
- name: Make SDK
shell: cmd
run: |
set SDK_NAME=ffmpeg-%FF_VERSION%-%TARGET_OS%-vs2022%CONFIG_SUFFIX%
move sdk* %SDK_NAME%
7z a -ssc -m0=lzma2 -mx=9 -ms=on -mf=off %SDK_NAME%.7z %SDK_NAME%
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-VS2022${{ matrix.config }}
path: ffmpeg-*.7z
VS2022LTL:
runs-on: windows-2022
env:
TARGET_OS: ${{ matrix.target }}
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [lite]
target: [windows-desktop]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: 'Restore dep cache'
id: dep-cache
uses: actions/cache@v3
with:
path: VC-LTL
key: dep-${{ env.VC_LTL_VER }}
- if: ${{ steps.dep-cache.outputs.cache-hit != 'true' }}
name: Get VC-LTL
shell: bash
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: cmd
run: |
set FF_BRANCH=%FF_VERSION%
if not [%FF_BRANCH%]==[master] set FF_BRANCH=release/%FF_VERSION%
git clone -b %FF_BRANCH% --depth 1 --no-tags https://git.ffmpeg.org/ffmpeg.git ffmpeg-%FF_VERSION%
if not [%CONFIG_SUFFIX%]==[-default] copy /y config%CONFIG_SUFFIX%.sh config.sh
- uses: msys2/setup-msys2@v2
with:
release: false # disable installation cache, so exe path in avbuild.sh is correct
msystem: MSYS
update: true
install: >-
make
diffutils
patch
pkg-config
nasm
yasm
- name: Install dev packages
shell: msys2 {0}
run: |
wget https://sourceforge.net/projects/avbuild/files/dep/dep.7z/download -O dep.7z
- name: Configure and Build
shell: cmd
run: |
7z x -y dep.7z -otools
set VC_LTL_DIR=%CD%\VC-LTL
set PKG_CONFIG_PATH_MFX=%CD%\tools\dep\VS2022LTL\lib\pkgconfig
set MSYS2_DIR=C:\msys64
set HOME=%CD%
set FFSRC=%CD%\ffmpeg-%FF_VERSION%
set BUILD_NOW=true
tools\vcbuild.bat VS2022 %TARGET_OS%10 all
- name: Make SDK
shell: cmd
run: |
set SDK_NAME=ffmpeg-%FF_VERSION%-%TARGET_OS%-vs2022ltl%CONFIG_SUFFIX%
move sdk* %SDK_NAME%
7z a -ssc -m0=lzma2 -mx=9 -ms=on -mf=off %SDK_NAME%.7z %SDK_NAME%
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-VS2022ltl${{ matrix.config }}
path: ffmpeg-*.7z
LAVFilters:
if: false
runs-on: ubuntu-latest
env:
FFREPO: 'git://git.1f0.de/ffmpeg'
TARGET_OS: 'windows-desktop'
COMPILER: clang
VCDIR: '/tmp/msvcrt-dev'
WINDOWSSDKDIR: '/tmp/winsdk'
PKG_CONFIG_PATH_MFX: '/tmp/dep/ClangCL/lib/pkgconfig'
AMF_DIR: "/tmp/dep/include"
CONFIG_SUFFIX: '-lavfilters'
steps:
- uses: actions/checkout@v3
if: ${{ env.FF_VERSION == 'master' }}
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
if: ${{ env.FF_VERSION == 'master' }}
id: sysroot-cache
uses: actions/cache@v3
with:
path: |
/tmp/winsdk
/tmp/msvcrt-dev
key: sysroot-${{ env.TARGET_OS }}${{ vars.WINSDKVER }}-vc${{ vars.VCVER }}${{ env.CONFIG_SUFFIX }}
- name: Create Build Environment
if: ${{ env.FF_VERSION == 'master' }}
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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
if: ${{ env.FF_VERSION == 'master' }}
shell: bash
run: |
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
export V=1
USE_TOOLCHAIN=clang-${LLVM_VER:-$LLVM_VER_DEFAULT} ./avbuild.sh $TARGET_OS "x86 x64"
- name: Make SDK
if: ${{ env.FF_VERSION == 'master' }}
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
if: ${{ env.FF_VERSION == 'master' }}
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-lavfilters
path: ffmpeg-*.tar.xz
Windows_clang:
runs-on: ubuntu-latest
env:
TARGET_OS: ${{ matrix.target }}
COMPILER: clang
VCDIR: '/tmp/msvcrt-dev'
WINDOWSSDKDIR: '/tmp/winsdk'
PKG_CONFIG_PATH_MFX: '/tmp/dep/ClangCL/lib/pkgconfig'
AMF_DIR: "/tmp/dep/include"
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [lite]
target: [windows-desktop]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: |
/tmp/winsdk
/tmp/msvcrt-dev
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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
shell: bash
run: |
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
USE_TOOLCHAIN=clang-${LLVM_VER:-$LLVM_VER_DEFAULT} ./avbuild.sh $TARGET_OS "arm64-clang-cl-${LLVM_VER:-$LLVM_VER_DEFAULT} arm x86 x64"
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
VCRT120_clang:
runs-on: ubuntu-latest
env:
TARGET_OS: windows-desktop
COMPILER: 'clang-vcrt120'
VCDIR: '/tmp/msvcrt-dev/120'
WINDOWSSDKDIR: '/tmp/winsdk'
AMF_DIR: "/tmp/dep/include"
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [lite]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: |
/tmp/winsdk
/tmp/msvcrt-dev
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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
shell: bash
run: |
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
export WindowsSdkDir=${WINDOWSSDKDIR}
export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
USE_TOOLCHAIN=clang-${LLVM_VER:-$LLVM_VER_DEFAULT} ./avbuild.sh $TARGET_OS "x86 x64"
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
Linux_clang:
runs-on: ubuntu-latest
env:
TARGET_OS: linux
COMPILER: clang
PKG_CONFIG_PATH_MFX: "/tmp/dep/linux64-gcc/lib/pkgconfig"
AMF_DIR: "/tmp/dep/include"
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [default,lite,lite-lto]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: /tmp/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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
shell: bash
run: |
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
export SYSROOT=/tmp/sysroot
export USER_OPT="--enable-wolfssl"
USE_TOOLCHAIN=clang-${LLVM_VER:-$LLVM_VER_DEFAULT} ./avbuild.sh linux "amd64 arm64 armhf"
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
Android:
runs-on: ubuntu-latest
env:
TARGET_OS: android
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [default,lite,lite-lto]
steps:
- uses: actions/checkout@v3
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: /tmp/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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build
shell: bash
run: |
export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
export USER_OPT="--enable-wolfssl"
./avbuild.sh ${TARGET_OS}
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
Upload:
runs-on: ubuntu-latest
needs: [VS2022]
steps:
- name: Download vs2022 desktop
uses: actions/download-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-windows-desktop-VS2022default
- name: Download vs2022 desktop lite
uses: actions/download-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-windows-desktop-VS2022lite
- name: Download vs2022 LTL desktop lite
uses: actions/download-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-windows-desktop-VS2022ltllite
- name: Download vs2022 uwp
uses: actions/download-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-uwp-VS2022default
- name: Download vs2022 uwp lite
uses: actions/download-artifact@v3
with:
name: ffmpeg-${{ env.FF_VERSION }}-uwp-VS2022lite
- name: Upload to SourceForge
if: (github.event_name != 'pull_request')
shell: bash
run: |
sudo apt update
sudo apt install -y sshpass
FFV=${{ env.FF_VERSION }}
for f in `ls ffmpeg-*.7z`; do
OS=${f%%-vs*}
OS=${OS##*${FFV}-}
sshpass -p $SF_PW_MAPPED scp -o StrictHostKeyChecking=no $f $SF_USER_MAPPED,[email protected]:/home/frs/project/a/av/avbuild/$OS
done