# Packaging
[`native-packages.yaml`](native-packages.yaml) is the packaging configuration:
it pins the shared CLI and nFPM versions and declares Linux amd64/arm64 inputs,
DEB/RPM/AppImage contents, dependencies, the macOS disk image and Windows
Installer packages, recipe templates and downstream repositories.
Application assets and native recipes stay in `packaging/`.
Public AUR, Homebrew, DEB/RPM and release download names use Spotifast, and
Linux packages install `spotifast` as the only executable.
Linux builds provide `spotifast.desktop` and `spotifast.svg`, matching the
native window and MPRIS desktop-entry ID. Flatpak installs those assets under
its full application ID and sets the window class to match.
`python3 packaging/test-launchers.py` exercises the actual AUR and Flatpak
installation commands with a release payload, using Ruby to read YAML.
Linux packages also install the optional Omarchy template and hook under
`share/spotifast/omarchy` in their installation prefix. The normal application
launch registers missing per-user files and prepares the current palette on an
Omarchy desktop, without changing existing files or the selected theme. Setup
runs in the background; package-manager scripts do not write into user homes.
DEB/RPM packages take these small assets from the checked-out configuration,
so package validation can still use the pinned older binary fixture. AUR and
portable Linux release archives carry the assets with their source/binary
payloads. Source and binary AUR recipes also accept older releases that predate
the integration; the git recipe requires the current files. Nix installs the
Linux desktop assets beside its binaries and packages the signed macOS
`Spotifast.app` bundle in the same derivation. Flatpak does not install host
desktop hooks.
```sh
gem install native-packages --version 0.11.0
native-packages validate
native-packages doctor --target linux-amd64 --target linux-arm64
native-packages build --release v1.2.3 --target linux-amd64 --target linux-arm64
native-packages build --release v1.2.3 --target appimage-amd64 --target appimage-arm64 --defer-recipes
```
Replace `v1.2.3` with an existing stable application release. Local use also
requires nFPM 2.47.0, `bsdtar`, `readelf` and, for the AppImage,
`mksquashfs` (squashfs-tools) and `zsyncmake` (zsync); AUR generation needs `makepkg`
or Docker. CI installs its tooling. To package local release archives, put
the selected target inputs and recipe assets under `dist/`, then run
`native-packages build --version 1.2.3 --target linux-amd64 --target linux-arm64`.
Outputs go to `dist/packages/1.2.3`; use `--output` for a fresh destination when rebuilding.
Before tagging, commit written notes at `packaging/release-notes/vVERSION.md`.
CI requires notes for the current Cargo version, and the release workflow
publishes that file immediately instead of a generated PR-only summary.
Verify the notes and their download links after the artifacts are published.
Stable tags run the existing native build jobs first. After binaries and
`checksums.txt` are published, the shared workflow verifies their hashes,
builds the configured packages, and attaches them to the GitHub release.
Configured recipes are attached as an archive. Package checksums are separate
from the original binary checksums. PR validation never publishes.
The Linux release runners are pinned to Ubuntu 24.04 (glibc 2.39). The native
packages target Ubuntu 24.04 / Debian 13 and newer, and Fedora 41 and newer.
Runtime-loaded GUI libraries must be declared explicitly in the YAML; ELF
inspection only discovers linked dependencies. The ALSA library mapping also
uses the Debian/Ubuntu `libasound2t64` name for this baseline.
Packaging CI builds both architectures using a pinned published release
(`v0.11.2`) for pushes and PRs, or the requested version for manual and release
runs. It then installs and removes each package in clean Ubuntu 24.04, Debian
13, Fedora 41 and current Fedora containers on native amd64 and arm64 runners.
Each case verifies that a settings fixture survives installation and removal,
runs `spotifast --version`, loads the GUI libraries with `dlopen`, and
verifies the desktop entry and icon. They cover installation and library
resolution, not a running desktop or Spotify playback. On release runs these
checks follow artifact attachment; a failure marks the workflow as failed.
The generated Homebrew cask is also installed, launched with `--version`,
signature-checked, and uninstalled on a native macOS runner. Wait for this
check before publishing the staged cask to the tap.
To repeat a check locally on the matching architecture, with Docker and a C
compiler available:
```sh
bash packaging/test-install.sh ubuntu:24.04 dist/packages/1.2.3
bash packaging/test-install.sh fedora:latest dist/packages/1.2.3
```
Review or publish an existing build with the same installed CLI:
```sh
native-packages publish --from dist/packages/1.2.3 --to github --target linux-amd64 --target linux-arm64
native-packages repositories
native-packages status --offline
```
For applications with configured AUR or Homebrew destinations, stage the
recipes with `native-packages stage TARGET dist/packages/1.2.3/recipes`,
inspect `native-packages diff TARGET`, run native package validation, and
publish with `native-packages publish TARGET`. These destinations use ignored
managed Git clones, recorded in this application's YAML configuration.
AUR automation needs `PUBLISH_AUR=true`, `AUR_SSH_KEY` and `AUR_KNOWN_HOSTS`;
Homebrew automation needs `PUBLISH_HOMEBREW=true` and
`HOMEBREW_TAP_GITHUB_TOKEN`. Enable only configured destinations.
The macOS and Windows targets and the Flatpak build step remain responsible
for their native artifacts. Additional nFPM formats require suitable platform
inputs and dependencies; adding a format does not port the application.
See the [shared CLI documentation](https://github.com/crmne/native-packages/tree/v0.11.0)
for commands and supported formats.
The manual **Flatpak from release** workflow can rebuild a missing Flatpak from
an existing tag. It verifies the published Linux archive against `checksums.txt`
and uses that tag's version and description with the current Flatpak app ID,
`rocks.spotifast.Spotifast`, without compiling or replacing binaries.
It uploads a workflow artifact only. After checking the bundle, attach it to the
existing release and add its hash to `checksums.txt`, preserving every existing
asset and checksum. Release tags stay immutable.
Check AUR source-directory compatibility against a downloaded source archive
with `bash packaging/test-arch-source.sh SOURCE_ARCHIVE VERSION`. It runs the
recipe's prepare/build/check directory handling with Cargo calls stubbed out;
it does not replace compilation or native package installation checks.
To upgrade the tool, change `tool.version` in `native-packages.yaml`, the matching
immutable workflow reference, and the gem installation pins in the release and
CI workflows together.
Applications need no packaging Gemfile, lockfile or Ruby wrapper.
## Fedora COPR
[`paolino/spotifast`](https://copr.fedorainfracloud.org/coprs/paolino/spotifast/)
gives Fedora users `dnf install spotifast` and updates through dnf. COPR
builds from source in each chroot (Fedora's own Rust, 1.98 or newer), offline,
so the release RPM's glibc 2.39 floor does not apply. The spec is
[`packaging/rpm/spotifast.spec.in`](packaging/rpm/spotifast.spec.in);
`packaging/rpm/build-srpm.sh VERSION DIR` downloads the release's source
archive, checks it against `checksums.txt`, vendors every crate `Cargo.lock`
names (`cargo vendor`, git dependencies included), renders the spec and makes
`DIR/spotifast-VERSION-1.src.rpm`. Windows-only crates (`windows*`,
`winapi-*-windows-gnu`) keep only their `Cargo.toml` and an empty library,
which still resolves `Cargo.lock` and saves about 40 MB of the source RPM. It needs `cargo`, `rpm-build`, `xz` and
`curl`. To test the build as COPR runs it, offline:
```sh
docker run --rm -v "$PWD:/src:ro" -v "$OUT:/w" fedora:latest bash -c \
'dnf install -y cargo rpm-build xz curl && /src/packaging/rpm/build-srpm.sh v1.2.3 /w'
# then, in a Fedora container with `dnf builddep` done and --network none:
rpmbuild --rebuild spotifast-1.2.3-1.src.rpm
```
The Packaging workflow's `copr` job makes the source RPM on release and
manual runs. With the repository variable `PUBLISH_COPR=true` and the secret
`COPR_CONFIG` (the `~/.config/copr` file from
, whose token expires after 180 days),
a publishing run submits it and waits for each chroot. Create the project once,
with the chroots hyprmoncfg uses:
```sh
copr-cli create spotifast \
--chroot fedora-44-x86_64 --chroot fedora-44-aarch64 \
--chroot fedora-45-x86_64 --chroot fedora-45-aarch64 \
--chroot fedora-rawhide-x86_64 --chroot fedora-rawhide-aarch64
```
Fedora's AI contribution policy asks that AI-assisted changes to Fedora
packaging carry an `Assisted-by:` trailer naming the tool and model, with a
person responsible for them: commits that change the spec or this build
carry one.
## Automatic macOS notarization
The macOS release job builds the app first, then selects
`macos-universal` from `native-packages.yaml` and uses `packaging/macos/dmg.rb`
to package it. Native Mac builds pass `--defer-recipes`, so they do not require
Linux inputs, AUR tooling or the not-yet-published DMG for Homebrew. The Linux
packaging job selects `linux-amd64,linux-arm64` from the same configuration
after the release assets exist and generates downstream recipes then.
The shared gem signs its owned input copy, notarizes the DMG, staples and validates
Apple's ticket, and only then records final checksums. Configure these repository
secrets, which the job exposes as environment variables:
- `APPLE_CERTIFICATE_P12`: base64 PKCS#12 Developer ID Application certificate and private key.
- `APPLE_CERTIFICATE_PASSWORD`: the export password.
- `APPLE_SIGNING_IDENTITY`: exact `Developer ID Application: Name (TEAMID)` identity.
- `APPLE_ID`, `APPLE_TEAM_ID`, `APPLE_APP_PASSWORD`: Apple email, Team ID and app-specific password.
A complete set enables notarization automatically. An incomplete set fails;
no values retain local builds without Developer ID signing. Application inputs
and the user's normal keychains remain unchanged. See the shared
[Apple setup and phase contract](https://github.com/crmne/native-packages/blob/v0.11.0/docs/apple-notarization.md).
After preparing `dist/macos-input` on a Mac, test packaging without publishing:
```sh
native-packages build \
--version 1.2.3 --target macos-universal --defer-recipes --output dist/macos-packages-test
```
Secret configuration applies to future builds. Existing published DMGs retain
their original signatures; this setup does not replace release assets.
## Windows signing
Tag releases sign `spotifast.exe` and the MSI with Azure Artifact Signing, as
**PlentyLabs UG (haftungsbeschränkt) & Co. KG**, through native-packages:
`windows.signing` in `native-packages.yaml` turns it on,
`native-packages sign-windows` signs `spotifast.exe` before the zip and the MSI
pack it, and `native-packages build` signs the MSI before recording its
checksum. Each
signature is SHA-256 Authenticode with Microsoft's RFC 3161 timestamp,
checked to be `Valid` and PlentyLabs' before the Windows job uploads the
release's Windows downloads (see native-packages'
[Windows code signing](https://github.com/crmne/native-packages/blob/v0.11.0/docs/_guides/windows-signing.md)).
The account, `plentylabs` in West Europe, is shared by Carmine's Windows apps
and managed in `crmne/terraform` (`azure/signing.tf`, its README's "Code
signing").
Azure Artifact Signing doesn't run on Arm runners, so the arm64 binary is
built, checked and started on `windows-11-arm` as before, then handed to the
release workflow's `windows` job on x64, which signs and packages both
architectures and replaces the binary's artifact with the packages.
No secret is involved. The `windows` jobs run in this repository's
`windows-signing` environment, which deploys only from `v*` tags, and sign in
through GitHub's OIDC token as the Entra app `GitHub spotifast Windows signing`.
That app trusts only `repo:crmne@106617/spotifast@1348483831:environment:windows-signing` (GitHub's immutable subject, with the owner's and repository's ids) and holds
the "Artifact Signing Certificate Profile Signer" role on the account. The
environment's variables, none of them secret, are `AZURE_CLIENT_ID`,
`AZURE_TENANT_ID`, `AZURE_SUBSCRIPTION_ID`, `AZURE_SIGNING_ENDPOINT`,
`AZURE_SIGNING_ACCOUNT` and `AZURE_SIGNING_PROFILE`.
`AZURE_SIGNING_PROFILE` names the Public Trust certificate profile
`plentylabs`, created once PlentyLabs' identity validation completed
(2026-10-26), so every tag release signs. Without the environment's signing
variables releases build unsigned; with only some of them, the Windows build
fails rather than ship unsigned.
A signature doesn't silence SmartScreen at once: reputation builds as people
download releases signed by the same publisher, so keep signing every release
with this identity.
## Windows Installer package
The release workflow's `windows` job, on x64 for both architectures, signs the
binary each Windows build job checked and builds the Windows Installer package
from it; releases up to 0.14.2 also shipped an Inno Setup program
(`-setup.exe`, `packaging/windows/spotifast.iss`). The package comes from `packaging/windows/spotifast.wxs` (WiX
Toolset 5): native-packages selects `windows-amd64` or `windows-arm64` with
`--defer-recipes` and runs `packaging/windows/build-msi.py`. That script
compiles the package's custom actions (`running-copy.c`,
`update-leftovers.c`) with the job's MSVC tools (cross-compiled for arm64), refuses an executable whose
version resource does not carry the release version, and runs WiX with
`-pdbtype none`, so the package is the only output.
Windows installs moved to the package while 0.13.0 to 0.14.2 shipped both
`-setup.exe` and `.msi`: those versions' updater prefers the package. Releases
after 0.14.2 ship only the package. 0.12.x and earlier look only for a
`-setup.exe`, so they no longer find updates; their users run the `.msi` once
(the download page says so), and it takes over their install.
`spotifast.iss` stays so `test-msi.py` can make a setup program install to
take over; `test-uninstall.py` and CI's Inno syntax check can go when nobody
needs them.
The updater (fastframe-update) runs `msiexec /i PACKAGE /qn /norestart /l*v LOG
INSTALLFOLDER=""` and accepts exit codes 0 and 3010. The package:
- installs per user, without elevation, to `%LOCALAPPDATA%\Programs\Spotifast`
or `INSTALLFOLDER`. Run by hand, it finds the folder an earlier package or
the setup program used.
- keeps one `UpgradeCode`, `{3DFFED43-88FE-4A31-9461-50BE03094316}`, forever.
An update replaces the earlier version in one transaction, so a failed
update restores it.
- takes over a setup program install in the same transaction. It replaces the
files, removes `unins000.*` and the `{FCED1EA0-EBF5-4C32-BA3B-A3AD724BACC3}_is1`
uninstall entry, and keeps the Start menu entry and the desktop shortcut
task. It never runs Inno's uninstaller, which would delete the package's files.
- installs the `spotifast-installer.txt` marker the updater looks for.
- replaces every file whatever its version or date (`REINSTALLMODE=amus`).
- closes a running installed copy before an update, and removes nothing while
it runs (#766). A portable copy elsewhere is never closed.
- removes the updater's staging folders (`.spotifast-update-*`, its helper
and the previous version) from the installation folder on a real uninstall,
so the folder goes too. Never in an update: there the old version is
uninstalled while the helper in one of them runs the package
(`update-leftovers.c`, conditioned on `REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE`).
To build it on Windows, install WiX with
`dotnet tool install --global wix --version 5.0.2` and open a Visual Studio
developer prompt for the target architecture. Put `spotifast.exe`, `README.md`,
`LICENSE` and `packaging\windows\spotifast-installer.txt` in a folder, then:
```powershell
python packaging\windows\build-msi.py FOLDER dist\spotifast.msi 1.2.3 amd64
```
With the same files in `dist\msi-input-x86_64-pc-windows-msvc`,
`native-packages build --version 1.2.3 --target windows-amd64 --defer-recipes`
builds it as the release does.
`python packaging\windows\test-msi.py [ISCC.exe]` installs, updates and removes
throwaway copies of the package, with an identity of their own, so it never
touches a real installation. It covers a running installed copy, a portable
copy, a missing executable, links another program took over, the updater's
staging folders in an uninstall and an update, and takeovers of a setup
program install. CI runs it on x64 and arm64.
`python packaging\windows\test-uninstall.py ISCC.exe` covers the setup
program's uninstaller.
## Portable archives
The release workflow puts `packaging/spotifast-portable.txt` (contents
`spotifast-portable-v1`) next to the executable in the Windows `.zip` and the
Linux `.tar.gz`. The updater reads it to decide that the copy may replace its
own executable. On Windows it also makes the copy keep its settings, state and
caches in `spotifast-data\` beside the executable (fastframe-dirs, #703), made
the first time from a copy of the per-user settings and state. Never put a
`spotifast-installer.txt` beside it: the installer marker wins, and the copy
would update through the package and use the per-user folders. Linux copies
keep the XDG folders. Keep the marker's name and contents as they are: older
releases recognise exactly that file.
## AppImages
The release's Linux build jobs build the AppImages, not the packaging
workflow: `native-packages build --target appimage-amd64` (or
`appimage-arm64`) packs the archive the job just made, and the files go into
the release with the binaries. `checksums.txt` therefore lists each AppImage
and its `.zsync` file, and `checksums.txt.sig` covers them; the app's updater
(fastframe-update with `appimage: true`) replaces an AppImage only with one
the signature covers. AppImages built by the packaging workflow would land in
the unsigned `packaging-checksums.txt` instead.
Each AppImage carries update information in its `.upd_info` section,
`gh-releases-zsync|crmne|spotifast|latest|spotifast-*-x86_64.AppImage.zsync`
(`aarch64` for ARM), so AppImageUpdate, AppImageLauncher, AM and Gear Lever
find the newest stable release's `.zsync` file and download only the blocks
that changed. The checks fail loudly instead of shipping a wrong string:
- native-packages refuses a pattern that does not match the target's own
`.zsync` file name or a repository other than `release.repository`, reads
the string back from the built AppImage, and checks the `.zsync` file's
name, length and SHA-1 against it.
- `packaging/release-names.py` refuses a stable release without an AppImage
and `.zsync` file for each Linux archive, an AppImage whose embedded string
is not the expected one, and a `.zsync` file that does not describe its
AppImage.
- The packaging workflow's AppImage jobs build one from the pinned release
the same way, run it, read the string back through the runtime's
`--appimage-updateinformation`, and on release runs check the published
AppImage, its `.zsync` file and their lines in `checksums.txt`.
To check a built AppImage by hand: `python3 packaging/check-appimage.py
spotifast-1.2.3-x86_64.AppImage x86_64`. Building AppImages locally needs
`zsyncmake` (the zsync package) as well as `mksquashfs`.
`packaging/release-names.py DIST TAG` checks the release's `spotifast-`
downloads and writes their checksums. Run `python3 packaging/test-release-names.py`
when changing this step. Published historical downloads are never rewritten.