Skip to content

Add CPack DEB packaging + release workflow (.deb per distro)#32

Open
gilesw wants to merge 5 commits into
evanpurkhiser:mainfrom
gilesw:feat/release-artifacts
Open

Add CPack DEB packaging + release workflow (.deb per distro)#32
gilesw wants to merge 5 commits into
evanpurkhiser:mainfrom
gilesw:feat/release-artifacts

Conversation

@gilesw

@gilesw gilesw commented Jun 21, 2026

Copy link
Copy Markdown

Summary

Adds two things downstream consumers (Ansible roles, homelab installers,
people who don't want to cmake two C++ libs by hand) keep asking for:

  1. CPack DEB configuration in CMakeLists.txtcpack -G DEB
    produces a .deb from any local build. CPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
    makes dpkg-shlibdeps derive Depends: from the binary's actual
    library references, so the package picks up the right
    libavformatN / libfftw3-double3 etc. for the build host.

  2. Tag-triggered release workflow (.github/workflows/release.yml)
    that runs the CPack DEB build in a per-distro container matrix and
    uploads the resulting .deb plus a .sha256 to the GitHub release.

The workflow builds libkeyfinder as a static library and links it
into the keyfinder-cli binary so the .deb is fully self-contained — the
only runtime deps are FFmpeg + fftw3, which apt resolves from the
distro archive.

Matrix

FFmpeg ABI differs across distros, so the .deb is per-distro:

  • ubuntu24 (FFmpeg 6 / libavformat60) — Ubuntu 24.04, Debian bookworm
  • debian13 (FFmpeg 7 / libavformat61) — Debian trixie, Ubuntu 25.04+

Both produce ~90KB packages.

Result

Consumers install with apt install ./keyfinder-cli_*_amd64.deb. No
/usr/local surgery, no ldconfig, no libkeyfinder build. Verified
on Debian trixie:

$ dpkg -I keyfinder-cli_1.2.0-prebuilt-3-debian13_amd64.deb | grep -E "Depends|Installed-Size"
 Depends: libavcodec61 (>= 7:7.1.4), libavformat61 (>= 7:7.1.4), libavutil59 (>= 7:7.1.4), libc6 (>= 2.34), libfftw3-double3 (>= 3.3.10), libgcc-s1 (>= 3.0), libstdc++6 (>= 13.1), libswresample5 (>= 7:7.1.4)
 Installed-Size: 329

$ ldd /usr/bin/keyfinder-cli | grep keyfinder
(empty — statically linked)

The existing per-push build workflow is untouched.

Test plan

Notes

  • The CMake add_executable name is keyfinder-cli (hyphen) which is
    what the .deb installs as. The legacy make install produced
    keyfinder_cli (underscore). Existing beets configs may need an
    update — minor downstream impact.
  • Static linking lives at the workflow level (-DBUILD_SHARED_LIBS=OFF
    on libkeyfinder's build), not baked into CMakeLists.txt, so manual
    builds keep the original behavior.

Giles Westwood added 5 commits June 21, 2026 20:39
… tarball

The existing CI builds keyfinder-cli but doesn't publish anything,
forcing downstream consumers (Ansible roles, package managers, etc.) to
rebuild both libkeyfinder and keyfinder-cli from source on every host.

This adds a separate workflow that, on tag push, builds keyfinder-cli
against a pinned libkeyfinder (v2.2.6) and bundles both binaries into
a tarball uploaded as a GitHub release asset, with a SHA-256 sum file.

The bundled libkeyfinder.so means consumers only need the standard
FFmpeg runtime libs (usually already present via `ffmpeg`). Layout in
the tarball matches a standard `/usr/local` prefix so installation is
`tar xzf` + copy + ldconfig.

Existing per-push build job is untouched.
…mpat

Ubuntu 24.04 ships FFmpeg 6 (libavformat.so.60); Debian trixie ships
FFmpeg 7 (libavformat.so.61). A binary built on one won't load on the
other. Build inside per-distro containers so consumers can pick the
tarball whose ABI matches their host.

Tarballs are now suffixed -ubuntu24 / -debian13 to make the choice
explicit; old single-tarball assets stay on the prior release.
CMakeLists gains a CPack DEB block — CPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
derives Depends: straight from dpkg-shlibdeps against the built binary,
so the right libavformatN / libfftw3-3 / etc. names land per build env.

Workflow now:
- builds libkeyfinder STATIC (-DBUILD_SHARED_LIBS=OFF -fPIC) so it
  links into the keyfinder-cli binary,
- runs `cpack -G DEB` after the build,
- uploads a single self-contained .deb per matrix entry (ubuntu24,
  debian13) plus its sha256.

Consumers install with `apt install ./keyfinder-cli_*_amd64.deb` — no
ldconfig handler, no /usr/local layout surgery, FFmpeg deps pulled in
through apt's resolver.

Tarball output dropped in favour of the .deb (one canonical artifact).
@gilesw gilesw changed the title Add release workflow: prebuilt Linux amd64 tarballs (ubuntu24 + debian13) Add CPack DEB packaging + release workflow (.deb per distro) Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant