Skip to content

release ffmpeg - temp #1

release ffmpeg - temp

release ffmpeg - temp #1

Workflow file for this run

# SPDX-FileCopyrightText: 2026 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Builds the bundled LGPL FFmpeg binaries for every supported platform and publishes them to
# a GitHub Release. Manually triggered: the FFmpeg version is pinned in
# scripts/ffmpeg/release.mjs and bumped via a normal PR; once that PR is merged, run this
# workflow (Actions tab → "Build FFmpeg binaries" → Run workflow) to build and release.
name: Build FFmpeg binaries
on:
workflow_dispatch:
# TEMP(dz/build-ffmpeg): test the build matrix on real runners before merge. The release
# job is guarded to only publish on workflow_dispatch, so these push runs build + upload
# artifacts without creating a release. Remove this `push:` block before merging.
push:
branches: [dz/build-ffmpeg]
permissions:
contents: write # create the release + upload assets
jobs:
config:
runs-on: ubuntu-latest
outputs:
ffmpeg: ${{ steps.rel.outputs.ffmpeg }}
opus: ${{ steps.rel.outputs.opus }}
tag: ${{ steps.rel.outputs.tag }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- id: rel
name: Read pinned FFmpeg release config
run: |
node -e "import('./scripts/ffmpeg/release.mjs').then(m => { \
const fs = require('fs'); \
fs.appendFileSync(process.env.GITHUB_OUTPUT, \
\`ffmpeg=\${m.FFMPEG_VERSION}\nopus=\${m.OPUS_VERSION}\ntag=\${m.RELEASE_TAG}\n\`); \
})"
build:
needs: config
strategy:
fail-fast: true
matrix:
include:
- target: darwin-arm64
runner: macos-14
- target: darwin-x64
runner: macos-13
- target: linux-x64
runner: ubuntu-22.04
- target: linux-arm64
runner: ubuntu-22.04-arm
- target: win32-x64
runner: ubuntu-22.04 # cross-compiled with mingw-w64
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Install build deps (macOS)
if: startsWith(matrix.runner, 'macos')
run: brew install nasm pkg-config automake autoconf libtool
- name: Install build deps (Linux native)
if: startsWith(matrix.runner, 'ubuntu') && matrix.target != 'win32-x64'
run: sudo apt-get update && sudo apt-get install -y nasm yasm pkg-config build-essential
- name: Install build deps (Windows cross)
if: matrix.target == 'win32-x64'
run: sudo apt-get update && sudo apt-get install -y nasm yasm pkg-config build-essential mingw-w64
- name: Build ffmpeg
env:
TARGET: ${{ matrix.target }}
FFMPEG_VERSION: ${{ needs.config.outputs.ffmpeg }}
OPUS_VERSION: ${{ needs.config.outputs.opus }}
OUTPUT_DIR: ${{ github.workspace }}/out
run: bash scripts/ffmpeg/build-ffmpeg.sh
- name: Package (gzip single binary)
run: |
cd "${{ github.workspace }}/out"
bin="ffmpeg"; [ "${{ matrix.target }}" = "win32-x64" ] && bin="ffmpeg.exe"
gzip -9 -c "$bin" > "ffmpeg-${{ matrix.target }}.gz"
- uses: actions/upload-artifact@v4
with:
name: ffmpeg-${{ matrix.target }}
path: ${{ github.workspace }}/out/ffmpeg-${{ matrix.target }}.gz
if-no-files-found: error
release:
needs: [config, build]
# TEMP(dz/build-ffmpeg): only publish on manual dispatch, so the push test runs above
# validate the builds without creating a release. Remove this `if:` before merging.
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Compute checksums
run: |
cd artifacts
sha256sum ffmpeg-*.gz > checksums.sha256
cat checksums.sha256
- name: Create / update release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.config.outputs.tag }}
name: ${{ needs.config.outputs.tag }}
body: |
LGPL v2.1+ FFmpeg ${{ needs.config.outputs.ffmpeg }} binaries built by
`scripts/ffmpeg/build-ffmpeg.sh` (statically linked libopus ${{ needs.config.outputs.opus }}).
Consumed by `@livekit/agents` at install time. See NOTICE for license details.
files: |
artifacts/ffmpeg-*.gz
artifacts/checksums.sha256