Skip to content

readme: fork and custom build #501

readme: fork and custom build

readme: fork and custom build #501

Workflow file for this run

name: Build
on:
push:
schedule:
- cron: '0 0 * * 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: 19
NINJA_STATUS: '[%f/%t %e %r]'
SF_PW_MAPPED: ${{ secrets.SF_PW }}
SF_USER_MAPPED: ${{ secrets.SF_USER }}
VC_LTL_VER: ${{ vars.VC_LTL_VER }}
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,lite-lto] # lto reduce about 300KB for lite build
target: [macOS,iOS,iOSSimulator,visionOS,visionOSSimulator,tvOS,tvOSSimulator,macCatalyst]
exclude:
- config: default
target: iOS
- config: default
target: iOSSimulator
- config: lite
target: iOSSimulator
- config: default
target: macCatalyst
- config: lite
target: macCatalyst
- config: default
target: tvOS
- config: default
target: tvOSSimulator
- config: lite
target: tvOSSimulator
- config: default
target: visionOS
- config: lite-lto # llvm-ar-17 merged visionOS lto libs has wrong contents (/,//,*.o/)
target: visionOS
- config: default
target: visionOSSimulator
- config: lite-lto
target: visionOSSimulator
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
run: sudo xcode-select -s /Applications/Xcode_15.4.app
- 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" || "${TARGET_OS}" == "tvOS"* || "${TARGET_OS}" == "xr"* || "${TARGET_OS}" == "vision"* ]] && 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@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
Wasm:
if: false
runs-on: macos-latest
env:
TARGET_OS: 'wasm'
steps:
- uses: actions/checkout@v4
- 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@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}
path: ffmpeg-*.tar.xz
RaspberryPiLegacy_clang:
if: false
runs-on: ubuntu-latest
env:
TARGET_OS: 'raspberry-pi'
COMPILER: 'clang'
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [lite]
steps:
- uses: actions/checkout@v4
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v4
with:
path: /tmp/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 }}
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
./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@v4
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]
exclude:
- config: default
target: uwp
steps:
- uses: actions/checkout@v4
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 -xr!*.pdb %SDK_NAME%.7z %SDK_NAME%
7z a -ssc -m0=lzma2 -mx=9 -ms=on -mf=off %SDK_NAME%-pdb.7z -ir!%SDK_NAME%\*.pdb
- name: Archieve SDK
uses: actions/upload-artifact@v4
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,default]
target: [windows-desktop]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: 'Restore dep cache'
id: dep-cache
uses: actions/cache@v4
with:
path: VC-LTL
key: dep-${{ vars.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${{ vars.VC_LTL_VER }}/VC-LTL-${{ vars.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 -xr!*.pdb %SDK_NAME%.7z %SDK_NAME%
7z a -ssc -m0=lzma2 -mx=9 -ms=on -mf=off %SDK_NAME%-pdb.7z -ir!%SDK_NAME%\*.pdb
- name: Archieve SDK
uses: actions/upload-artifact@v4
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@v4
if: ${{ env.FF_VERSION == 'master' }}
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
if: ${{ env.FF_VERSION == 'master' }}
id: sysroot-cache
uses: actions/cache@v4
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:
SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
./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@v4
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@v4
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v4
with:
path: |
/tmp/winsdk
/tmp/msvcrt-dev
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 }}
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
./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 x86 x64"
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v4
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@v4
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v4
with:
path: |
/tmp/winsdk
/tmp/msvcrt-dev
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 }}
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
./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@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}-vcrt120
path: ffmpeg-*.tar.xz
MinGW_GCC:
runs-on: ubuntu-latest
env:
TARGET_OS: mingw
COMPILER: gcc
PKG_CONFIG_PATH_MFX: "/tmp/dep/MinGW/lib/pkgconfig"
AMF_DIR: "/tmp/dep/include"
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [lite]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Create Build Environment
shell: bash
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
./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@v4
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" # TODO:
AMF_DIR: "/tmp/dep/include"
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [default,lite,lite-lto]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v4
with:
path: /tmp/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 }}
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
./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@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-${{ env.TARGET_OS }}-${{ matrix.config }}
path: ffmpeg-*.tar.xz
Android:
runs-on: macos-latest
env:
TARGET_OS: android
CONFIG_SUFFIX: -${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [lite,lite-lto]
steps:
- uses: actions/checkout@v4
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v4
with:
path: /tmp/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 }}
run: ./tools/ci-before-build.sh
- name: Configure and Build 32bit
shell: bash
run: |
export ANDROID_NDK=$ANDROID_HOME/ndk/25.2.9519653 # ndk25, api19
export FFSRC=$PWD/ffmpeg-${FF_VERSION}
export USER_OPT="--enable-wolfssl"
./avbuild.sh ${TARGET_OS} "armv7 x86"
mv sdk-android-clang{,32}
- name: Configure and Build 64bit
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} "arm64 x86_64"
rsync -auv --ignore-existing sdk-android-clang{32/*,}
rm -rf sdk-android-clang32
- name: Make SDK
shell: bash
run: ./tools/ci-after-build.sh
- name: Archieve SDK
uses: actions/upload-artifact@v4
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@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-windows-desktop-VS2022default
- name: Download vs2022 desktop lite
uses: actions/download-artifact@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-windows-desktop-VS2022lite
- name: Download vs2022 LTL desktop lite
uses: actions/download-artifact@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-windows-desktop-VS2022ltllite
- name: Download vs2022 LTL desktop
uses: actions/download-artifact@v4
with:
name: ffmpeg-${{ env.FF_VERSION }}-windows-desktop-VS2022ltldefault
- name: Download vs2022 uwp lite
uses: actions/download-artifact@v4
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,avbuild@frs.sourceforge.net:/home/frs/project/a/av/avbuild/$OS
done