Release Packaging Formats
releases specs/releases/packaging.kmd
Formatos canônicos de pacote por plataforma (.deb, .rpm, .apk, .AppImage, .kpkg, .msi, .dmg). Regras de publicação, naming dos assets com nome fixo, conteúdo mínimo. Distinto de `policies/releases.kmd` (workflow de release) e `specs/kpkg/format.kmd` (formato do .kpkg).
Quando esta spec se aplica
Todos os triggers
- Empacotar produto como .deb, .rpm, .apk, .AppImage, .kpkg, .msi ou .dmg
- Definir naming de asset de release
- Adicionar nova plataforma ao pipeline de packaging
Corpo da especificação
Spec — Release Packaging Formats
Applicability
Every Koder product that produces distributable artifacts (desktop, mobile, server, library). Applies to the release flow triggered by /com_rel_syn_dpl and friends.
Format Hierarchy
| Priority | Format | Channel | Notes |
|---|---|---|---|
| Primary | .kpkg |
Koder Hub | Universal bundle; one file, all platforms. Produced by kpkg build. |
| Secondary | .deb / .rpm / .AppImage / .Flatpak |
Linux distros | For users who don't use Koder Hub. |
| Secondary | .msix / .msi |
Windows | Required for Flutter desktop; WinRM → s.win.local. |
| Secondary | .pkg / .ipa / .apk |
macOS / iOS / Android | Platform stores. |
| Legacy | tar.gz |
Direct download | Accepted for apps not yet producing .kpkg; will be deprecated. |
Rule: every Flutter desktop app must produce a .kpkg via kpkg build --from-bundle in addition to any secondary formats. The .kpkg is what khub install downloads by default; secondary formats are for external channels only.
Required Formats
When generating a release, produce packages for all applicable formats from this list:
| Format | Target | Build Tool | Host Requirement |
|---|---|---|---|
deb |
Ubuntu, Debian, Mint | dpkg-deb |
Linux |
rpm |
Fedora, Red Hat, SUSE | rpmbuild |
Linux |
Flatpak |
Linux (sandboxed) | flatpak-builder |
Linux |
Snap |
Linux (Canonical) | snapcraft --destructive-mode |
Linux |
AppImage |
Linux (portable) | appimagetool |
Linux |
MSIX |
Windows 10/11 (Flutter desktop apps) | dart run msix:create |
WinRM → s.win.local ou k.win |
MSI |
Windows (Go CLIs / instaladores simples) | wixl (msitools) |
Linux (cross-build OK) |
BAT |
DOS | shell | any |
app |
macOS Application Bundle | Xcode | macOS |
pkg |
macOS Installer Package | pkgbuild |
macOS |
ipa |
iOS App Store Package | Xcode | macOS |
apk |
Android | Gradle / Flutter | any |
Rules
- Skip non-applicable formats — do not build an
apkfor a desktop-only program. - Skip formats the host cannot produce AND cannot install the tools for — e.g.,
ipawithout macOS. If the tool can be installed on Linux (snapcraft,flatpak-builder,wixl,appimagetool), install it and generate the package — do not skip. - MSIX obrigatório para Flutter desktop — todo módulo Koder que tenha
app/desktop/(Flutter desktop) e cujokoder.tomlliste"windows"emplatforms, ou que possa vir a ter UI Windows (produto com usuário final, mesmo sem o diretório ainda), deve gerar.msixem toda release. Usardart run msix:createvia WinRM →s.win.localouk.win. Verpolicies/windows-builds.kmd §2para o fluxo completo. Não pular este formato alegando "não há máquina Windows disponível" — sempre delegar para a VM. - Every commit gets a release — when the user asks to "commit" (via
/com_rel_syn_dpl), always generate a release with all applicable packages after committing. - Public packages, private repos — all Koder repositories remain private. Public download of release assets is controlled by two repo-level flags:
public_releases=true— enables anonymous download of release assetspublic_binaries_only=true— restricts to the Flow binary allowlist:.deb,.rpm,.apk,.aab,.appimage,.snap,.flatpak,.msi,.exe,.dmg,.pkg,.ipa,.bin,.7z,.zip,.tar.xz,.tar.zst,.tar.bz2- Source
.tar.gzauto-generated by Flow remain private - Enable once per repo via:
PATCH /api/v1/repos/{owner}/{repo} {"public_releases": true, "public_binaries_only": true} - After enabling, all binaries of all past and future releases are anonymous-downloadable automatically
- Do not use
PATCH .../assets/{id}withis_public:true— that field does not exist in the Flow schema and is silently ignored - Do not create separate
*-releasesrepositories
- Latest alias — after creating a release, ensure Koder Flow has the
/releases/latestshortcut pointing at the newest release. The URLhttps://flow.koder.dev/{owner}/{repo}/releases/latestmust always redirect to the latest release. Gitea/Forgejo supports this natively — do not disable. - Fixed-name assets for permanent downloads — when uploading assets, always upload two copies of each artifact: one with the versioned name (e.g.
vivver-id-v1.0.9.apk) and one with the fixed, unversioned name (e.g.vivver-id.apk). This lets the URLhttps://flow.koder.dev/{owner}/{repo}/releases/download/latest/{fixed-name}work as a permanent link always pointing at the latest artifact. Fixed-name pattern:{product-name}.{ext}. When telling the user URLs, prefer the/latest/URL with the fixed name.
Public URLs
- Recommended (readable):
https://flow.koder.dev/{owner}/{repo}/releases/download/{tag}/{file}— the handlerRedirectDownloadPublicis outsideRepoAssignmentand works anonymously. - Alternative (top-level attachment):
https://flow.koder.dev/attachments/{uuid}— also anonymous. - Backup mirror:
dl.koder.devserved from/var/www/dl.koder.dev/ons.k.linbykoder-jet— available as a fallback if you don't want to depend on Flow.
Commit Flow Integration
The /com_rel_syn_dpl skill is the canonical way to commit + release + sync + deploy in one step. It enforces rules 1–6 automatically.
Referências
policies/releases.kmdspecs/kpkg/format.kmdspecs/binaries-and-cli/naming.kmd