Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
442a6a7
readme
akashskypatel Jul 22, 2026
b537824
Merge branch 'master' into dev
akashskypatel Aug 26, 2026
23d41c2
init wasm scripts (112/157) completed
akashskypatel Aug 28, 2026
50834ec
ci: add ci options to workflows
akashskypatel Aug 28, 2026
9f47cf1
feat: add ci workflow
akashskypatel Aug 28, 2026
1c75a6e
fix: ci workflow on call
akashskypatel Aug 28, 2026
646a8ef
ci: fix permissions
akashskypatel Aug 28, 2026
1333b66
ci: fix container permissions
akashskypatel Aug 28, 2026
8d5ed4b
ci: fix workflow
akashskypatel Aug 28, 2026
65fba6a
ci: fix workflow
akashskypatel Aug 28, 2026
5a3f365
fix: preserve argv across FFmpeg, FFprobe, and FFplay (#72)
akashskypatel Aug 31, 2026
94a1a83
wasm32 153/153 success deps build
akashskypatel Sep 2, 2026
75b6a04
wasm32 all deps and full ffmpeg success
akashskypatel Sep 2, 2026
b84cb68
ci: wasm
akashskypatel Sep 3, 2026
224fcbe
fix wasm toolchain setup
akashskypatel Sep 3, 2026
07bf9c5
fix wasm toolchain setup
akashskypatel Sep 3, 2026
34a4cd5
ci(wasm): build_gettext
akashskypatel Sep 3, 2026
b4f48ce
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
b1cd591
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
d7b35c5
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
759159d
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
669f3a6
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
402f7d8
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
999dfec
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
d8bfacf
fix(ci): build_libvmaf
akashskypatel Sep 3, 2026
a6fcdbc
fix(ci): build_librtmp
akashskypatel Sep 3, 2026
4e05564
fix(ci): build_librtmp
akashskypatel Sep 3, 2026
b50ab9f
fix(ci): build_libbluray
akashskypatel Sep 3, 2026
166bdb4
fix(ci): build_libtwolame and deps
akashskypatel Sep 3, 2026
191cb8d
fix(ci): build_libcdio
akashskypatel Sep 3, 2026
6df9c73
fix(ci): build_libmysofa
akashskypatel Sep 3, 2026
102ed3d
fix(ci): build_libdavs2
akashskypatel Sep 3, 2026
a26e194
fix(ci): build_libopencolorio, build_libopencv, build_libcodec2, buil…
akashskypatel Sep 3, 2026
cc24cff
feat: ffmpeg-kit full wasm build success
akashskypatel Sep 3, 2026
4ee1236
fix(ci): build_libopencolorio
akashskypatel Sep 3, 2026
8b5c725
fix cmake for wasm
akashskypatel Sep 3, 2026
0654217
fftools/ffmpeg_filter: use uint8_t for sub2video destination
akashskypatel Sep 3, 2026
273d6f2
feat: wasm ffplay passthrough
akashskypatel Sep 8, 2026
4797e0f
docs: docs for wasm ffplay wrapper functions
akashskypatel Sep 9, 2026
f4a337d
fix(wasm): sdl2 with threading
akashskypatel Sep 9, 2026
37b4d8e
fix: sdl2 audio playback for wasm emscripten
akashskypatel Sep 10, 2026
7ada080
fix(core): give exported session handles independent ownership
akashskypatel Sep 10, 2026
5787ee8
test(wasm): establish pthread callback test harness
akashskypatel Sep 11, 2026
9cf6ad8
fix(core): invoke callbacks outside callback-state locks
akashskypatel Sep 11, 2026
d6b5b24
fix(core): make async pthread startup failure-safe
akashskypatel Sep 11, 2026
37f14d8
fix(wrapper): synchronize global callback state
akashskypatel Sep 11, 2026
68f6d12
feat(wrapper): add session-id callback ABI for wasm-safe dispatch
akashskypatel Sep 11, 2026
e849c80
feat(wasm): add main-runtime callback dispatcher
akashskypatel Sep 11, 2026
b9350b5
fix(wasm): proxy session completion callbacks to runtime thread
akashskypatel Sep 11, 2026
c1a1410
fix(wasm): proxy log and statistics callbacks safely
akashskypatel Sep 11, 2026
008660f
test(wasm): verify native callback layer independently of dart
akashskypatel Sep 11, 2026
b0a8e6c
build(wasm): allow indirect function table growth
akashskypatel Sep 11, 2026
db15581
test(wasm): add indirect function table growth contract
akashskypatel Sep 11, 2026
5c14c71
test(wasm): prove C callback to JS round trips
akashskypatel Sep 12, 2026
b8891e2
docs(wasm): make test references library generic
akashskypatel Sep 12, 2026
5ebcc02
docs: summarize Wasm callback changes
akashskypatel Sep 12, 2026
077e69d
refactor: global callbacks use direct int64_t session IDs, _v2 and fa…
akashskypatel Sep 12, 2026
8ee7385
fix(wasm): route callbacks through browser runtime
akashskypatel Sep 12, 2026
06f54bc
fix(wasm): stabilize callback dispatch and synchronization
akashskypatel Sep 13, 2026
84ae9e6
fix(wasm): dispatch callbacks through dedicated queue
akashskypatel Sep 14, 2026
80c0efc
fix(wasm): isolate callback suites and disable FFplay callbacks
akashskypatel Sep 14, 2026
f9e5689
fix(libwebp): switch to cmake config https://github.com/akashskypatel…
akashskypatel Sep 14, 2026
3b3ccfc
fix: wasm libtiff
akashskypatel Sep 16, 2026
a0373a1
feat: add transitive deps finder helper script
akashskypatel Sep 17, 2026
b5b3923
fix: libleptonica for linux and android after libwebp changes
akashskypatel Sep 17, 2026
5d63051
fix: android libtiff
akashskypatel Sep 17, 2026
a8073c7
fix(wasm): support apt-based toolchain hosts
akashskypatel Sep 17, 2026
6892de3
fix(wasm): treat rustup as optional
akashskypatel Sep 17, 2026
60933e8
fix(wasm): detect system Python fallback
akashskypatel Sep 17, 2026
137af06
Revert "fix(wasm): detect system Python fallback"
akashskypatel Sep 18, 2026
fc19137
Revert "fix(wasm): treat rustup as optional"
akashskypatel Sep 18, 2026
fca1702
Revert "fix(wasm): support apt-based toolchain hosts"
akashskypatel Sep 18, 2026
13b7f68
fix: port FFmpeg 9.0.2 fftools fixes
akashskypatel Sep 18, 2026
2fd12a0
docs: bump ffmpeg version in deocs
akashskypatel Sep 19, 2026
9047d9c
docs: bump ffmpeg version in deocs
akashskypatel Sep 19, 2026
0c0aa73
test: add Review 23 native callback ABI oracles
akashskypatel Sep 22, 2026
37df2b5
feat: add owned v2 global log callback ABI
akashskypatel Sep 22, 2026
21327eb
perf: sequence native log history with constant-time indexing
akashskypatel Sep 22, 2026
5afb4e9
test: prove v2 callback cleanup and completion ordering
akashskypatel Sep 22, 2026
22796e3
fix: preserve opaque handle and redirection authority
akashskypatel Sep 22, 2026
7fa36fe
test: synchronize native sanitizer fixtures
akashskypatel Sep 22, 2026
196567d
fix: close native sanitizer leaks
akashskypatel Sep 22, 2026
fc35587
ci: add builders source snapshot workflow
akashskypatel Sep 22, 2026
e9de475
fix(linux): cache native static library resolution
akashskypatel Sep 22, 2026
13f4521
perf(cmake): unify non-recursive library lookup
akashskypatel Sep 22, 2026
e43b51e
fix(cmake): preserve MinGW import library lookup
akashskypatel Sep 22, 2026
28ed2cc
FFK24-N8: pin the structured global log ABI
akashskypatel Sep 22, 2026
d654d59
FFK24-N8: remove redundant callback ABI marker
akashskypatel Sep 22, 2026
a0b9c93
FFK24-N8: remove source-level runtime version pin
akashskypatel Sep 22, 2026
aad083c
Add verified local stream test fixtures
Sep 23, 2026
4e76cbf
eol changes
akashskypatel Sep 23, 2026
3b1b6d8
feat: add test instrumentation to ffmpeg libs
akashskypatel Sep 23, 2026
625c345
fix(build): align sanitizer and Wasm test configuration
akashskypatel Sep 23, 2026
189a6e7
release: publish 0.11.3 structured callback runtime
akashskypatel Sep 23, 2026
b74da2c
revert: publish 0.11.3 structured callback runtime
akashskypatel Sep 23, 2026
72e1939
fix: build scripts
akashskypatel Oct 4, 2026
8d3264a
ignores
akashskypatel Oct 4, 2026
c716069
fix: batch build script
akashskypatel Oct 4, 2026
e0ea89c
ci: add builders source snapshot mailbox
akashskypatel Oct 4, 2026
7575e0e
chore: publish ffmpeg-kit-builders-source-snapshot run 37223002057 at…
github-actions[bot] Oct 4, 2026
fac2076
fix: restore Apple FFplay renderer frames
akashskypatel Oct 4, 2026
9b8730f
fix: terminate native log messages with line feeds
akashskypatel Oct 5, 2026
0497aaf
Merge remote-tracking branch 'origin/dev' into dev-wasm
akashskypatel Oct 5, 2026
7539a6f
fix: build_libjpeg_turbo
akashskypatel Oct 5, 2026
1124aa1
fix: build_libpng
akashskypatel Oct 5, 2026
d388b76
fix: build_libpng
akashskypatel Oct 5, 2026
dde7e35
fix: build_libaom
akashskypatel Oct 5, 2026
d5d63a3
fix: build_libaom
akashskypatel Oct 5, 2026
ca8f940
fix: build_libaom
akashskypatel Oct 5, 2026
38151c8
fix: build_libopenh264 and build_giflib
akashskypatel Oct 5, 2026
a2eb0df
fix: meson cross file
akashskypatel Oct 5, 2026
54c4646
feat: add wiki as submodule
akashskypatel Oct 6, 2026
8b7aa34
sync wiki
akashskypatel Oct 6, 2026
22255d3
banner
akashskypatel Oct 6, 2026
167cc39
fix: update workflow runner to rebuilt dependents on build only reque…
akashskypatel Oct 6, 2026
dd5ef6f
fix: build_libpng
akashskypatel Oct 6, 2026
2be0877
fix: build_libkvazaar macOS/Android/Linux
akashskypatel Oct 6, 2026
022f220
fix: build_libjpeg_turbo android/ios/tvos
akashskypatel Oct 6, 2026
5ff043e
feat: add ability to built multiple build steps from runner, add gnu.…
akashskypatel Oct 6, 2026
4ef6d8d
feat: switch to zlib-ng for better performance
akashskypatel Oct 6, 2026
77a2254
feat(wasm): switch to zlib-ng for better performance
akashskypatel Oct 6, 2026
f871215
chore: update help and docs
akashskypatel Oct 6, 2026
0a29103
fix: gnu libraries
akashskypatel Oct 7, 2026
1a6257a
fix: windows libffi patch not needed
akashskypatel Oct 7, 2026
e4190fe
fix: apply patch helper
akashskypatel Oct 7, 2026
fffdd40
fix: remove puthon setup during env setup
akashskypatel Oct 7, 2026
e025c61
fix: linux build_libmodplug
akashskypatel Oct 7, 2026
16ed55b
fix: windows build_vapoursynth
akashskypatel Oct 7, 2026
acb712c
fix: windows librabbitmq
akashskypatel Oct 7, 2026
4b1611b
fix: apply patch helper
akashskypatel Oct 7, 2026
7e4accb
fix: set apple default rust toolchain
akashskypatel Oct 7, 2026
715803e
fix: windows build_libxavs2
akashskypatel Oct 7, 2026
551dac8
fix: apply patch helper
akashskypatel Oct 7, 2026
a21fe50
chore/fix: clean up stale patches
akashskypatel Oct 7, 2026
a18caee
fix: apple libdovi rust toolchain
akashskypatel Oct 7, 2026
f660b8a
Preserve configured Rust paths during cargo install
akashskypatel Oct 7, 2026
cdb76f1
fix: wasm libopencolorio
akashskypatel Oct 7, 2026
a65e123
fix: switch lcevc to tarball due to git checkout issue
akashskypatel Oct 7, 2026
4deb174
fix: make ffmpeg session cancellation race-safe
akashskypatel Oct 7, 2026
b72fbee
fix: sanitize malformed utf-8 log messages
akashskypatel Oct 7, 2026
b45d23b
test: verify ffprobe concurrent output isolation
akashskypatel Oct 7, 2026
579791c
feat: config aware ffmpeg-kit cmake
akashskypatel Oct 7, 2026
2417850
fix: remove unnecessary duo
akashskypatel Oct 7, 2026
5f53e7f
fix: update android toolchain setup and aar script (credit #88)
akashskypatel Oct 7, 2026
fafd16c
feat: add docker image builder workflow (credit #88)
akashskypatel Oct 7, 2026
e8a0f4b
chore: delete obsolete files
akashskypatel Oct 7, 2026
82bf55d
Merge branch 'master' into dev-wasm
akashskypatel Oct 7, 2026
12f79f1
fix: revert ffmpeg_lib.c
akashskypatel Oct 7, 2026
066a697
fix: apple auto-tools hard coded paths
akashskypatel Oct 7, 2026
e8047cb
fix: macos zlib-ng
akashskypatel Oct 8, 2026
17739be
fix: apple zlib-ng
akashskypatel Oct 8, 2026
84e9bfc
fix: zlib and libzimg android
akashskypatel Oct 8, 2026
b377d05
fix: apple sim configs for some libs
akashskypatel Oct 8, 2026
18bedfd
fix: guard cancellation during scheduler graph setup
akashskypatel Oct 9, 2026
b6e44b5
test: cover scheduler cancellation readiness
akashskypatel Oct 9, 2026
a5467c1
chore: publish ffmpeg-kit-builders-source-snapshot run 37871241688 at…
github-actions[bot] Oct 9, 2026
7b79d47
chore: publish ffmpeg-kit-builders-source-snapshot run 37873622453 at…
github-actions[bot] Oct 9, 2026
5eaf43a
fix: android lto issue
akashskypatel Oct 9, 2026
cb1b3af
chore: publish ffmpeg-kit-builders-source-snapshot run 37875819781 at…
github-actions[bot] Oct 9, 2026
e7e7cd1
chore: publish ffmpeg-kit-builders-source-snapshot run 37887318656 at…
github-actions[bot] Oct 9, 2026
214a7b9
Harden FFmpegKit final binary export verification
akashskypatel Oct 9, 2026
d20c2f5
Complete Apple package export evidence and guidance
akashskypatel Oct 9, 2026
71722e2
Parse universal Mach-O dependency listings correctly
akashskypatel Oct 9, 2026
31e5c24
Record build flags in export verification reports
akashskypatel Oct 9, 2026
9332d55
Guard unattributed logging helper for tests
akashskypatel Oct 9, 2026
bcc3485
Forward export acceptance flags to CMake
akashskypatel Oct 10, 2026
a01d705
Compare WASM exports by stable public API
akashskypatel Oct 10, 2026
cf80cb7
fix: export FS in WASM binaries
akashskypatel Oct 11, 2026
f9bcc79
fox(wasm): prevent audio-frame queue wait from causing browser freeze
akashskypatel Oct 13, 2026
a3fe48b
fix: rtmps streaming config
akashskypatel Oct 13, 2026
dc5e09d
fix: disable libcurl for wasm
akashskypatel Oct 13, 2026
e1d9dbc
update docs
akashskypatel Oct 13, 2026
8fa7d13
fix: disable fftools for ffmpeg if building kit
akashskypatel Oct 13, 2026
801abb5
feat(wasm): add bounded HTTP streaming and FFplay teardown
akashskypatel Oct 14, 2026
a8db6f1
fix(wasm): reject inconsistent HTTP range responses
akashskypatel Oct 14, 2026
0a1fd27
fix(wasm): reject AES-128 HLS explicitly
akashskypatel Oct 14, 2026
055d1f7
perf(wasm): adapt progressive HTTP range sizes
akashskypatel Oct 14, 2026
3ddd986
test(wasm): complete N10 HLS metadata coverage
akashskypatel Oct 14, 2026
e086e7c
test(wasm): cover residual HLS close lifecycles
akashskypatel Oct 14, 2026
ef2afd1
wasm: add audio lifecycle coverage and baseline mapping support
akashskypatel Oct 14, 2026
b6cedc0
test(wasm): match S06 checks to FFplay pause semantics
akashskypatel Oct 14, 2026
d85d656
fix(wasm): warn on ignored browser HTTP options
akashskypatel Oct 14, 2026
7c4db21
fix(wasm): harden HTTP admission and URL credentials
akashskypatel Oct 14, 2026
92583b9
fix(wasm): defer fetch closes and test R5 transport failures
akashskypatel Oct 14, 2026
cedb038
Redact URL secrets from FFmpeg logs
akashskypatel Oct 14, 2026
306c2a3
Test URL Basic auth in production Wasm
akashskypatel Oct 14, 2026
480754e
fix(wasm): bound shared HTTP admission and defer fetch teardown
akashskypatel Oct 15, 2026
c7c507f
test(wasm): await asynchronous consistency-error logs
akashskypatel Oct 15, 2026
5a0a615
docs: wasmstreaming design
akashskypatel Oct 15, 2026
03aba0d
chore: file permissions
akashskypatel Oct 15, 2026
779cecd
fix(wasm): preserve callback message accounting during execution
akashskypatel Oct 15, 2026
45b5d59
feat: improve versioning string
akashskypatel Oct 15, 2026
f45e4d7
fix: remove all abi version checks from tests
akashskypatel Oct 16, 2026
9925446
docs: remove procedural minutia
akashskypatel Oct 16, 2026
2221f8c
build(scripts): OS detection for defaults
akashskypatel Oct 16, 2026
185480e
feat(runner): add custom bundle name option
akashskypatel Oct 16, 2026
6516066
feat(scripts): add WASM config variable
akashskypatel Oct 16, 2026
fc0e9c4
build: drop unused wasm deps, disable features
akashskypatel Oct 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ ENV PATH="/opt/python/cp312-cp312/bin:${PATH}"

RUN python3 --version && pip3 --version && \
pip3 install numpy Cython setuptools && \
sudo ln -sf /opt/python/cp312-cp312/bin/cython /bin/cython
ln -sf /opt/python/cp312-cp312/bin/cython /bin/cython

# 3. Create 'vscode' user
# Manylinux images are root-only by default. We must recreate the vscode user
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_on_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ on:
target_platforms:
required: true
type: string
default: linux,windows,android
default: linux,windows,android,wasm
target_archs:
required: true
type: string
default: x86_64,aarch64,armv7a
default: x86_64,aarch64,armv7a,wasm32
bundles:
required: true
type: string
Expand All @@ -43,12 +43,12 @@ on:
target_platforms:
description: "Comma-separated target platforms this runner can build"
required: true
default: "linux,windows,android"
default: "linux,windows,android,wasm"
type: string
target_archs:
description: "Comma-separated target architectures to try for each selected platform"
required: true
default: "x86_64,aarch64,armv7a"
default: "x86_64,aarch64,armv7a,wasm32"
type: string
force:
description: "Force rebuild instead of using existing self release artifacts"
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/builder_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: builder_image

on:
workflow_dispatch:

permissions:
contents: read
packages: write

concurrency:
group: builder-image
# A newer immutable image build supersedes an older one. This also prevents
# an unresponsive BuildKit process from blocking the replacement run.
cancel-in-progress: true

jobs:
image:
name: Publish Linux builder image
runs-on: ubuntu-24.04
timeout-minutes: 120
steps:
- name: Checkout dispatched source commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Log in to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1

- name: Build and publish builder image
id: build
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: .devcontainer/Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/ffmpeg-kit-builders-dev:sha-${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/ffmpeg-kit-builders-dev:latest
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Record immutable builder image reference
env:
IMAGE_DIGEST: ${{ steps.build.outputs.digest }}
shell: bash
run: |
image="ghcr.io/${GITHUB_REPOSITORY_OWNER}/ffmpeg-kit-builders-dev"
test -n "$IMAGE_DIGEST"
{
echo "image=${image}"
echo "source_sha=${GITHUB_SHA}"
echo "digest=${IMAGE_DIGEST}"
echo "immutable_ref=${image}@${IMAGE_DIGEST}"
} | tee builder-image-provenance.txt
{
echo '### Builder image'
echo
echo 'Use this digest as the `builder_image_digest` input for the Android AAR workflows:'
echo
echo '```text'
echo "$IMAGE_DIGEST"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"

- name: Upload builder image provenance
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ffmpeg-kit-builder-image-${{ github.run_number }}-${{ github.run_attempt }}
path: builder-image-provenance.txt
if-no-files-found: error
retention-days: 90
152 changes: 141 additions & 11 deletions .github/workflows/repo-source-snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
name: FFmpegKit Builders Source Snapshot

on:
workflow_call:
inputs:
source_ref:
description: Exact branch, tag, or commit to snapshot. Empty uses the caller event SHA.
required: false
type: string
default: ""
artifact_prefix:
description: Prefix for snapshot and log artifacts.
required: false
type: string
default: ffmpeg-kit-builders-source-snapshot
retention_days:
description: Artifact retention in days.
required: false
type: number
default: 7
include_submodules:
description: Recursively initialize Git submodules.
required: false
type: boolean
default: true
include_lfs:
description: Fetch Git LFS objects during checkout.
required: false
type: boolean
default: false
outputs:
snapshot_sha:
description: Exact checked-out source commit.
value: ${{ jobs.snapshot.outputs.snapshot_sha }}
artifact_name:
description: Uploaded source snapshot artifact name.
value: ${{ jobs.snapshot.outputs.artifact_name }}
artifact_id:
description: Uploaded source snapshot artifact ID.
value: ${{ jobs.snapshot.outputs.artifact_id }}
artifact_url:
description: Authenticated URL for the uploaded source snapshot artifact.
value: ${{ jobs.snapshot.outputs.artifact_url }}
artifact_digest:
description: Digest reported by actions/upload-artifact.
value: ${{ jobs.snapshot.outputs.artifact_digest }}
secrets:
GH_TOKEN:
required: false

workflow_dispatch:
inputs:
source_ref:
Expand All @@ -9,10 +56,10 @@ on:
type: string
default: ""
artifact_prefix:
description: Prefix for snapshot and diagnostic artifacts.
description: Prefix for snapshot and log artifacts.
required: false
type: string
default: ffmpeg-kit-builders-source
default: ffmpeg-kit-builders-source-snapshot
retention_days:
description: Artifact retention in days.
required: false
Expand All @@ -29,16 +76,22 @@ on:
type: boolean
default: false

permissions:
contents: read

concurrency:
group: ffmpeg-kit-builders-source-snapshot-${{ github.repository_id }}-${{ github.ref }}
cancel-in-progress: false

jobs:
snapshot:
permissions:
contents: read
runs-on: ubuntu-24.04
outputs:
snapshot_sha: ${{ steps.metadata.outputs.snapshot_sha }}
artifact_name: ${{ steps.metadata.outputs.artifact_name }}
artifact_id: ${{ steps.upload.outputs['artifact-id'] }}
artifact_url: ${{ steps.upload.outputs['artifact-url'] }}
artifact_digest: ${{ steps.upload.outputs['artifact-digest'] }}

steps:
- name: Initialize diagnostic log
shell: bash
Expand All @@ -55,6 +108,7 @@ jobs:
echo "ref=${GITHUB_REF}"
echo "repository=${GITHUB_REPOSITORY}"
echo "runner_os=${RUNNER_OS}"
echo "runtimeExecution=false"
echo "started_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
} | tee -a "$log"

Expand All @@ -65,27 +119,49 @@ jobs:
fetch-depth: 1
submodules: ${{ inputs.include_submodules && 'recursive' || 'false' }}
lfs: ${{ inputs.include_lfs }}
token: ${{ secrets.GH_TOKEN || github.token }}
persist-credentials: false

- name: Verify recursive submodule materialization
if: ${{ inputs.include_submodules }}
shell: bash
run: |
set -euo pipefail
log="${RUNNER_TEMP}/ffmpeg-kit-builders-source-snapshot.log"
exec > >(tee -a "$log") 2>&1
if git submodule status --recursive | grep -E '^-'; then
echo "one or more submodules are uninitialized" >&2
exit 2
fi
git submodule status --recursive

- name: Verify source authority
id: metadata
env:
REQUESTED_REF: ${{ inputs.source_ref != '' && inputs.source_ref || github.sha }}
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix != '' && inputs.artifact_prefix || 'ffmpeg-kit-builders-source' }}
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix != '' && inputs.artifact_prefix || 'ffmpeg-kit-builders-source-snapshot' }}
shell: bash
run: |
set -euo pipefail
log="${RUNNER_TEMP}/ffmpeg-kit-builders-source-snapshot.log"
exec > >(tee -a "$log") 2>&1
trap 'status=$?; echo "verify_source_exit=${status}"' EXIT

snapshot_sha="$(git rev-parse HEAD)"
artifact_name="${ARTIFACT_PREFIX}-${GITHUB_RUN_ID}"

echo "requested_ref=${REQUESTED_REF}"
echo "snapshot_sha=${snapshot_sha}"
echo "git_version=$(git --version)"
echo "tar_version=$(tar --version | head -n 1)"
echo "rsync_version=$(rsync --version | head -n 1)"
git status --short

if [[ "${REQUESTED_REF}" =~ ^[0-9a-fA-F]{40}$ ]] && [[ "${snapshot_sha,,}" != "${REQUESTED_REF,,}" ]]; then
echo "exact source SHA mismatch: requested=${REQUESTED_REF}; actual=${snapshot_sha}" >&2
exit 3
fi

echo "snapshot_sha=${snapshot_sha}" >> "$GITHUB_OUTPUT"
echo "artifact_name=${artifact_name}" >> "$GITHUB_OUTPUT"

Expand All @@ -100,34 +176,51 @@ jobs:
set -euo pipefail
log="${RUNNER_TEMP}/ffmpeg-kit-builders-source-snapshot.log"
exec > >(tee -a "$log") 2>&1
trap 'status=$?; echo "snapshot_archive_exit=${status}"' EXIT

out="${RUNNER_TEMP}/ffmpeg-kit-builders-source-snapshot-result"
source_dir="${out}/source"
rm -rf "$out"
mkdir -p "$source_dir"
rsync -a --exclude='.git' --exclude='.git/**' "${GITHUB_WORKSPACE}/" "$source_dir/"

rsync -a \
--exclude='.git' \
--exclude='.git/**' \
--exclude='.workflow-mailbox' \
--exclude='.workflow-mailbox/**' \
"${GITHUB_WORKSPACE}/" "$source_dir/"

if find "$source_dir" -name .git -print -quit | grep -q .; then
echo "snapshot unexpectedly contains .git metadata" >&2
exit 4
fi

(
cd "$out"
find source -type f -print0 | LC_ALL=C sort -z | xargs -0 -r sha256sum > SHA256SUMS
find source -type f -print0 \
| LC_ALL=C sort -z \
| xargs -0 -r sha256sum > SHA256SUMS

: > SYMLINKS.tsv
while IFS= read -r -d '' link; do
printf '%s\t%s\n' "$link" "$(readlink "$link")"
done < <(find source -type l -print0 | LC_ALL=C sort -z) > SYMLINKS.tsv

if [[ "$INCLUDE_SUBMODULES" == "true" ]]; then
git -C "$GITHUB_WORKSPACE" submodule status --recursive > SUBMODULES.txt
else
: > SUBMODULES.txt
fi

tar -czf source.tar.gz source
sha256sum source.tar.gz > source.tar.gz.sha256
)

file_count="$(find "$source_dir" -type f | wc -l | tr -d ' ')"
symlink_count="$(find "$source_dir" -type l | wc -l | tr -d ' ')"
byte_count="$(du -sb "$source_dir" | awk '{print $1}')"
archive_sha="$(awk '{print $1}' "${out}/source.tar.gz.sha256")"

jq -n \
--arg repository "$GITHUB_REPOSITORY" \
--arg event "$GITHUB_EVENT_NAME" \
Expand All @@ -141,11 +234,30 @@ jobs:
--argjson byte_count "$byte_count" \
--argjson include_submodules "$INCLUDE_SUBMODULES" \
--argjson include_lfs "$INCLUDE_LFS" \
'{repository: $repository, event: $event, event_sha: $event_sha, snapshot_sha: $snapshot_sha, artifact_name: $artifact_name, archive_sha256: $archive_sha256, file_count: $file_count, symlink_count: $symlink_count, byte_count: $byte_count, include_submodules: $include_submodules, include_lfs: $include_lfs, generated_at: $generated_at}' \
> "${out}/snapshot-metadata.json"
'{
repository: $repository,
event: $event,
event_sha: $event_sha,
snapshot_sha: $snapshot_sha,
artifact_name: $artifact_name,
archive_sha256: $archive_sha256,
file_count: $file_count,
symlink_count: $symlink_count,
byte_count: $byte_count,
include_submodules: $include_submodules,
include_lfs: $include_lfs,
runtimeExecution: false,
generated_at: $generated_at
}' > "${out}/snapshot-metadata.json"

echo "snapshot_file_count=${file_count}"
echo "snapshot_symlink_count=${symlink_count}"
echo "snapshot_byte_count=${byte_count}"
echo "archive_sha256=${archive_sha}"
cat "${out}/snapshot-metadata.json"

- name: Upload source snapshot
id: upload
uses: actions/upload-artifact@v4
with:
name: ${{ steps.metadata.outputs.artifact_name }}
Expand Down Expand Up @@ -176,7 +288,25 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_prefix != '' && inputs.artifact_prefix || 'ffmpeg-kit-builders-source' }}-log-${{ github.run_id }}
name: ${{ inputs.artifact_prefix != '' && inputs.artifact_prefix || 'ffmpeg-kit-builders-source-snapshot' }}-log-${{ github.run_id }}
path: ${{ runner.temp }}/ffmpeg-kit-builders-source-snapshot.log
if-no-files-found: error
retention-days: ${{ inputs.retention_days }}

mailbox:
if: always()
needs: [snapshot]
permissions:
actions: read
contents: write
uses: ./.github/workflows/workflow-mailbox-publisher.yml
with:
workflow_key: ffmpeg-kit-builders-source-snapshot
source_sha: ${{ needs.snapshot.outputs.snapshot_sha != '' && needs.snapshot.outputs.snapshot_sha || github.sha }}
source_ref: ${{ inputs.source_ref != '' && inputs.source_ref || github.ref }}
result: ${{ needs.snapshot.result }}
summary: Repository source snapshot for the requested frozen implementation source.
artifact_name: ${{ needs.snapshot.outputs.artifact_name }}
artifact_id: ${{ needs.snapshot.outputs.artifact_id }}
artifact_url: ${{ needs.snapshot.outputs.artifact_url }}
artifact_digest: ${{ needs.snapshot.outputs.artifact_digest }}
Loading
Loading