build: strip debug sections and remove double-zip from Windows artifact

The release build type emits DWARF .debug_* sections even for the MinGW
cross build, inflating libmpv-2.dll to ~169 MB. Strip them with
TARGET-strip --strip-all so only code/data remain. Also hand upload-artifact
the folder directly instead of a pre-zipped file, so the artifact is a
single-level archive rather than a zip containing a zip.
This commit is contained in:
david
2026-09-30 17:40:12 +02:00
parent 5d267ed82e
commit ca0a5de2a9
2 changed files with 10 additions and 9 deletions
+4 -7
View File
@@ -90,17 +90,14 @@ jobs:
echo "name=mpv-natives-windows-x86_64-mpv-$VER" >> "$GITHUB_OUTPUT"
echo "version=$VER" >> "$GITHUB_OUTPUT"
- name: Zip artifact
run: |
cd artifact-libmpv
zip -9r "../${{ steps.artifact.outputs.name }}.zip" .
ls -l ..
# upload-artifact zips the directory itself, so handing it the folder
# (not a pre-zipped file) yields a single-level archive without the
# double-zip wrapper.
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.name }}
path: ${{ steps.artifact.outputs.name }}.zip
path: artifact-libmpv
- name: Save ccache
uses: actions/cache/save@v4
+6 -2
View File
@@ -297,11 +297,15 @@ mkdir -p artifact
LIBMPV_DLL=$(find $build -maxdepth 1 -name 'libmpv-*.dll' | head -n 1)
[ -n "$LIBMPV_DLL" ] || { echo "ERROR: libmpv DLL not found in $build"; ls -l $build; exit 1; }
cp -pv "$LIBMPV_DLL" artifact/
# buildtype=release emits DWARF .debug_* sections even for MinGW; for a
# distributable native we strip them out (~130 MB) so only the code/data
# sections remain.
"$TARGET-strip" --strip-all "artifact/$(basename "$LIBMPV_DLL")"
# import library, for native linkers that want it (jlibmpv uses JNA, optional)
cp -pv "$build/libmpv.dll.a" artifact/ 2>/dev/null || true
cp -pv "$build"/libmpv*.dll.a artifact/ 2>/dev/null || true
cp -pv "$build"/*.h artifact/ 2>/dev/null || true
echo "=== artifact contents ==="
ls -l artifact
echo "=== libmpv-2.dll import dependencies (should be Windows system DLLs only) ==="
"$TARGET-objdump" -p artifact/$(basename "$LIBMPV_DLL") | grep -A500 "DLL Name" | grep -E "DLL Name" || true
"$TARGET-objdump" -p "artifact/$(basename "$LIBMPV_DLL")" | awk '/DLL Name/{print $3}' || true