TExcelTAD
Home › Release Engineering & CI/CD › Packaging Strategies

Packaging Strategies

The same build can reach users in very different containers: a tarball on a download page, a .deb in an apt repository, a container image, a Windows installer, an app-store bundle. Each format brings its own naming, versioning, signing and update rules. A release engineer chooses formats by asking how users install and update, then automates every format from the same tagged build.

The options

Strategy Users install with Updates Good for Where to learn the tooling
Archives (.tar.gz, .zip) download + unpack manual (or a self-updater) CLIs, portable tools, "just give me the binary" Artifact Naming & Checksums, CPack Basics
Language registries (npm, PyPI, crates.io, Maven Central, NuGet, Go proxy) npm install, pip install, cargo install version ranges, lockfiles libraries and developer tools JS, Python, Cargo, Go, Java, .NET
OS packages (.deb, .rpm, Homebrew, winget, Chocolatey, Scoop) apt install, dnf install, brew install, winget install the OS package manager system tools, daemons, anything that needs dependencies from the OS DEB Packages, Components & Other Generators
Container images (OCI) docker pull, a Kubernetes manifest new tag/digest, rolled out by the platform services, reproducible runtime environments Docker, Multi-stage Builds, Registries & Tags
Installers (MSI/MSIX, .pkg, .dmg, AppImage, Flatpak, Snap) double-click, software centre built-in updaters or store desktop applications Components & Other Generators (NSIS, WIX, DragNDrop)
App stores (Steam, Google Play, App Store, Microsoft Store, itch.io) the store the store, with review games and consumer apps Mobile Build Pipelines, Steam, itch.io, Google Play & the App Store

Most products ship two or three of these: a CLI might publish archives, a Homebrew formula and a container image; a game ships to Steam and itch.io from the same build.

Versions per format

The canonical SemVer version from your tag has to be translated for some formats:

Format 2.0.0-rc.1 becomes Why
archive file name tad-2.0.0-rc.1-linux-x86_64.tar.gz as is
.deb 2.0.0~rc.1-1 ~ sorts before the release; -1 is the package revision
.rpm Version: 2.0.0~rc.1, Release: 1 same ~ rule in modern rpm
PyPI 2.0.0rc1 PEP 440
container tag 2.0.0-rc.1 (plus 2.0, 2, latest only for final releases) tags can't contain +
Windows MSI numeric major.minor.build only, e.g. 2.0.0 (ProductVersion has no pre-release syntax; a fourth field is ignored when comparing) pre-releases need a separate product line or channel
Android versionCode / iOS CFBundleVersion a monotonically increasing integer next to the display version stores compare the build number, not the name

The rule from Version & Build Numbers applies everywhere: one source of truth (the tag), and every format's number derived from it by a script.

A real .deb in two commands

The Debian package format is simple enough to build by hand: a DEBIAN/control file plus the files laid out as they'll be installed. dpkg-deb (part of every Debian and Ubuntu system) builds and inspects it:

bash · try it yourself
mkdir -p pkg/DEBIAN pkg/usr/bin
printf '#!/bin/sh\necho "tad 1.4.2"\n' > pkg/usr/bin/tad && chmod 755 pkg/usr/bin/tad
cat > pkg/DEBIAN/control <<'CTRL'
Package: tad
Version: 1.4.2-1
Architecture: all
Maintainer: Ada Lovelace <ada@example.com>
Description: Example release tool
 A tiny package built by hand for the release course.
CTRL
dpkg-deb --root-owner-group --build pkg tad_1.4.2-1_all.deb
dpkg-deb --info tad_1.4.2-1_all.deb | sed -n '3,$p'
dpkg-deb --contents tad_1.4.2-1_all.deb
dpkg-deb --root-owner-group --build pkg again.deb >/dev/null
cmp -s tad_1.4.2-1_all.deb again.deb && echo "rebuilt package is byte-identical"
for v in "1.4.2~rc.1-1 lt 1.4.2-1" "1.4.2-2 gt 1.4.2-1" "1.10.0-1 gt 1.9.0-1"; do
  dpkg --compare-versions $v && echo "true:  $v"
done
dpkg-deb: building package 'tad' in 'tad_1.4.2-1_all.deb'.
     179 bytes,     6 lines      control
 Package: tad
 Version: 1.4.2-1
 Architecture: all
 Maintainer: Ada Lovelace <ada@example.com>
 Description: Example release tool
  A tiny package built by hand for the release course.
drwxr-xr-x root/root         0 2026-01-01 00:00 ./
drwxr-xr-x root/root         0 2026-01-01 00:00 ./usr/
drwxr-xr-x root/root         0 2026-01-01 00:00 ./usr/bin/
-rwxr-xr-x root/root        27 2026-01-01 00:00 ./usr/bin/tad
rebuilt package is byte-identical
true:  1.4.2~rc.1-1 lt 1.4.2-1
true:  1.4.2-2 gt 1.4.2-1
true:  1.10.0-1 gt 1.9.0-1

--root-owner-group stores files as root-owned regardless of who built the package, and dpkg-deb honours SOURCE_DATE_EPOCH for file times, so the package is reproducible. dpkg --compare-versions confirms the ~ and revision rules from the table. Real projects generate packages from the build system instead (CPack DEB runs dpkg-shlibdeps to compute library dependencies) or with tools such as nFPM and GoReleaser (Toolkit), and publish them into a signed apt repository.

Choosing, in practice

  • Start with archives + checksums. They work everywhere, cost nothing, and every other format can be built from the same binaries.
  • Add what your users already use. Developers on macOS expect Homebrew; Kubernetes users expect an image; Windows users expect winget or an installer.
  • Each format is a maintenance commitment: a signing key or certificate, a repository to host, a review process (stores), a format-specific test. Don't add one nobody asked for.
  • Build every format in the same pipeline from the same tag. A .deb built on a different day from a different commit than the tarball is a support nightmare.

Test yourself

How should 2.0.0-rc.1 be written as a Debian package version so that 2.0.0 is newer?

  1. 2.0.0-rc.1
  2. 2.0.0~rc.1-1
  3. 2.0.0+rc.1
  4. rc.1-2.0.0

What is the best first packaging format for a new CLI tool?

  1. An MSI installer
  2. Archives per platform plus a checksum file
  3. Only a Snap
  4. A Steam release

Why do Android and iOS need a build number separate from the display version?

  1. Stores compare a monotonically increasing integer to order uploads
  2. Display versions can't contain dots
  3. For localisation
  4. They don't