Files
LibreMediaConverter/.github/workflows/build.yml
T
JMR-devandClaude Opus 5 128763e99c Commit the FFmpeg binary so test runs stop depending on a rebuild
CI rebuilt FFmpeg on every cold cache, which made results ambiguous: a red run
could mean the code was broken or that a forty-minute cross-compile of FFmpeg,
x264, x265 and SVT-AV1 had hiccuped. Those are not the same signal, and only
one of them is worth a developer's attention. The archive is now checked in
under bin/, so a failing run points at code.

It also removes roughly forty minutes from a cold run and lets a fresh clone
build without a container toolchain.

bin/README.md records provenance -- upstream tag, FFmpeg version, NDK, ABIs,
SHA-256 and the full configure line read back out of the shipped libavutil --
so the binary is auditable rather than opaque. The recipe in tools/ffmpeg
remains the authority: this archive is its output, and is also what satisfies
the GPL corresponding-source obligation.

The status check is now seven independent runners: one validating the archive,
one for the JVM tests, and one per API level from 33 to 37. The FFmpeg job
verifies rather than builds. It asserts native libraries are present for both
ABIs and that every one is 16 KB aligned, which is a Play requirement that is
easy to lose in a rebuild and expensive to discover at submission. Checking
for file existence alone would not do: a Git LFS pointer checked out without
LFS passes that and then surfaces as an obscure linker error much later.

It is a separate job rather than a step in each emulator run so a bad archive
reports once, clearly, instead of five confusing emulator failures.

build.yml no longer builds FFmpeg either, and keeps only its post-merge and
release duties.

Two costs, deliberately accepted. The repository goes from about 1 MB to
35 MB, and every future rebuild adds another 35 MB blob to history
permanently, so bin/README.md says to regenerate only when the FFmpeg version
or the configure flags actually change. And F-Droid's scanner flags checked-in
native libraries, so submitting there needs a scandelete entry for bin/ --
noted in bin/README.md, and nothing prevents a from-source build.

Verified against the relocated archive: 66 unit tests, and 40 instrumented
tests on an API 36 emulator, 0 failures.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 13:18:10 -05:00

80 lines
2.5 KiB
YAML

name: Build
# Pull requests are covered by status_check.yml, which runs the unit tests and the
# instrumented suite across API 33-37. This workflow keeps the post-merge and release
# duties and does not duplicate PR validation.
on:
push:
branches: [main]
tags: ['v*']
jobs:
test:
name: Unit tests and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17' # AGP 9 requires JDK 17
- uses: gradle/actions/setup-gradle@v4
- name: Unit tests
run: ./gradlew testDebugUnitTest
- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-report
path: app/build/reports/tests/
release:
name: Release
needs: [test]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
- name: Build release artifacts
run: ./gradlew assembleRelease bundleRelease
# GPL-3.0 requires that complete corresponding source accompany the binary.
# FFmpeg's guidance says to host it on the same server as the binary; for a Play
# listing that is impossible, so it is attached to the GitHub release next to the
# APK and linked from both the store listing and the in-app About screen.
- name: Assemble corresponding source
run: |
mkdir -p release-source
cp -r tools/ffmpeg release-source/
{
echo "FFmpeg corresponding source for ${GITHUB_REF_NAME}"
echo
echo "Upstream: https://github.com/arthenica/ffmpeg-kit-next"
echo "Tag: v8.1.1 (FFmpeg 8.1.2)"
echo
echo "The exact configure line used is printed in the build log and is"
echo "reproduced by running tools/ffmpeg as documented in its README."
} > release-source/README.txt
tar czf ffmpeg-corresponding-source.tar.gz release-source
- uses: softprops/action-gh-release@v2
with:
files: |
app/build/outputs/apk/release/*.apk
app/build/outputs/bundle/release/*.aab
ffmpeg-corresponding-source.tar.gz
LICENSE
LICENSES/README.md