fix(packaging): release the FWS fork version instead of the kitty version
CI / check (push) Canceled after 10m13s
Release / check (push) Successful in 3m6s
Release / release (push) Failing after 3m35s

The release tag, the Gitea release and the Arch package were named after the
upstream kitty release (0.50.0), so a fork release was indistinguishable from
an upstream one and disagreed with the version the binaries announce (0.1.6).
The version file and pkgver now follow the fork, while the embedded kitty
release stays in _kittyver and is checked against kitty/constants.py.
This commit is contained in:
BlackAngelTV committed 2026-11-25 10:41:18 +01:00
1 parent 54934eb03a
commit f38246f71d
5 files changed
+62 -33

No files matched your search

+15 -8
View File
@@ -301,20 +301,27 @@ _branch=feat/file-manager-panel
### Publication automatique ### Publication automatique
`version`, à la racine, est la source de vérité des releases : il doit rester `version`, à la racine, est la source de vérité des releases. Il suit la version
égal à `version` dans `kitty/constants.py` et à `pkgver` dans du fork FWS (`0.1.6`), pas la version amont de kitty embarquée dans le paquet :
`packaging/PKGBUILD` (`packaging/check-version.sh` vérifie les trois et échoue c'est elle qui nomme le tag, la release et le paquet
sinon). Un push sur `main` qui modifie `version` déclenche `fws-kitty-<version>-<rel>`. Il doit rester égal à `pkgver` dans
`packaging/PKGBUILD` et à la version affichée par `fws-kitty`
(`tools/cli/help.go`, `kitty/launcher/main.c`) ; `packaging/check-version.sh`
vérifie l'ensemble, ainsi que `_kittyver` du `PKGBUILD` contre
`kitty/constants.py`, et échoue sinon. Un push sur `main` qui modifie `version`
déclenche
`.gitea/workflows/package.yml` : lint, build, tests, paquet `makepkg`, release `.gitea/workflows/package.yml` : lint, build, tests, paquet `makepkg`, release
Gitea `v<version>` avec le paquet en pièce jointe, puis envoi à Gitea `v<version>` avec le paquet en pièce jointe, puis envoi à
`repo.laxacube.ch`. `.gitea/workflows/ci.yml` rejoue les mêmes contrôles sur `repo.laxacube.ch`. `.gitea/workflows/ci.yml` rejoue les mêmes contrôles sur
chaque PR et chaque push sur `main`. chaque PR et chaque push sur `main`.
Pour reconstruire la même version amont (correctif de packaging), incrémentez Pour reconstruire la même version du fork (correctif de packaging), incrémentez
`pkgrel` dans `packaging/PKGBUILD` puis lancez le workflow à la main `pkgrel` dans `packaging/PKGBUILD` puis lancez le workflow à la main
(*Actions → Release → Run workflow*) : le paquet `0.50.0-3` remplace alors le (*Actions → Release → Run workflow*) : le paquet `0.1.6-2` remplace alors le
`0.50.0-2`. Une nouvelle version demande `version`, `kitty/constants.py` et `0.1.6-1`. Une nouvelle version du fork demande `version`, `pkgver` et les deux
`pkgver`, avec `pkgrel=1`. La publication vers `repo.laxacube.ch` utilise le front-ends, avec `pkgrel=1` ; pour suivre une nouvelle version de kitty, mettre
à jour `_kittyver` et `kitty/constants.py`. La publication vers
`repo.laxacube.ch` utilise le
secret `REPO_TOKEN` du dépôt, la release Gitea le secret `RELEASE_TOKEN` ; sans secret `REPO_TOKEN` du dépôt, la release Gitea le secret `RELEASE_TOKEN` ; sans
`REPO_TOKEN` la release est créée mais le dépôt pacman n'est pas mis à jour. `REPO_TOKEN` la release est créée mais le dépôt pacman n'est pas mis à jour.
+8 -2
View File
@@ -11,13 +11,19 @@
# upstream package, hence provides/conflicts. # upstream package, hence provides/conflicts.
pkgname=fws-kitty pkgname=fws-kitty
pkgver=0.50.0 # Fork version from the version file: it names the release and the package.
pkgrel=3 # The upstream kitty release built inside is tracked by _kittyver below.
pkgver=0.1.6
pkgrel=1
pkgdesc='Fast, feature-rich, GPU based terminal (FWS fork with the file-manager kitten)' pkgdesc='Fast, feature-rich, GPU based terminal (FWS fork with the file-manager kitten)'
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')
url='https://gitea.nocode-var.tech/FWS/FWS-Kitty' url='https://gitea.nocode-var.tech/FWS/FWS-Kitty'
license=('GPL-3.0-only') license=('GPL-3.0-only')
# Upstream kitty release shipped by this package. It is independent from pkgver
# and must match kitty/constants.py (checked by check-version.sh).
_kittyver=0.50.0
# Replace main with the tag or commit to ship once the release is cut. # Replace main with the tag or commit to ship once the release is cut.
_branch=main _branch=main
_repo='https://gitea.nocode-var.tech/FWS/FWS-Kitty.git' _repo='https://gitea.nocode-var.tech/FWS/FWS-Kitty.git'
+8 -5
View File
@@ -84,14 +84,17 @@ Le workflow a besoin de deux secrets du dépôt :
| `REPO_TOKEN` | `POST https://repo.laxacube.ch/api/packages` | | `REPO_TOKEN` | `POST https://repo.laxacube.ch/api/packages` |
Sans `REPO_TOKEN`, la release est créée mais le dépôt pacman n'est pas mis à Sans `REPO_TOKEN`, la release est créée mais le dépôt pacman n'est pas mis à
jour (le workflow émet un avertissement). Pour reconstruire la même version jour (le workflow émet un avertissement). Pour reconstruire la même version du
amont, incrémentez `pkgrel` ici et lancez le workflow manuellement ; le paquet fork, incrémentez `pkgrel` ici et lancez le workflow manuellement ; le paquet
`0.50.0-3` remplace le `0.50.0-2` dans la base `fws.db` reconstruite côté `0.1.6-2` remplace le `0.1.6-1` dans la base `fws.db` reconstruite côté
serveur. Le `PKGBUILD` lit `FWS_SOURCE_REF` (`commit=<sha>` depuis la CI) pour serveur. Le `PKGBUILD` lit `FWS_SOURCE_REF` (`commit=<sha>` depuis la CI) pour
construire le commit publié plutôt que la tête de `main`. construire le commit publié plutôt que la tête de `main`.
`packaging/check-version.sh` vérifie avant le build que `version`, `pkgver` est la version du fork FWS (fichier `version` à la racine), pas celle
`kitty/constants.py` et `pkgver` ci-dessus sont identiques. de kitty : la version amont embarquée est dans `_kittyver`.
`packaging/check-version.sh` vérifie avant le build que `version` et `pkgver`
concordent avec la version compilée dans `tools/cli/help.go` et
`kitty/launcher/main.c`, et que `_kittyver` correspond à `kitty/constants.py`.
### Runner ### Runner
+30 -17
View File
@@ -1,8 +1,10 @@
#!/bin/sh #!/bin/sh
# The version file is the single source of truth for a release: it triggers the # The version file is the single source of truth for a release: it triggers the
# packaging workflow and names the tag and the Gitea release. The version is # packaging workflow and names the tag, the Gitea release and the Arch package.
# also duplicated where kitty and makepkg expect it, so this script checks they # It tracks the FWS fork version, which is independent from the upstream kitty
# still agree and prints the version for the workflows to reuse: # release shipped inside the package. Both numbers are duplicated where the
# build reads them, so this script checks they still agree and prints the
# release version for the workflows to reuse:
# #
# version="$(packaging/check-version.sh)" # version="$(packaging/check-version.sh)"
# #
@@ -10,33 +12,44 @@
set -eu set -eu
root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd) root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
fail() {
echo "::error file=$1::$2"
exit 1
}
version=$(tr -d '[:space:]' < "$root/version") version=$(tr -d '[:space:]' < "$root/version")
case "$version" in case "$version" in
''|*[!0-9.]*|.*|*..*|*.) ''|*[!0-9.]*|.*|*..*|*.)
echo "::error file=version::expected MAJOR.MINOR.PATCH, got '$version'" fail version "expected MAJOR.MINOR.PATCH, got '$version'"
exit 1
;; ;;
esac esac
if [ "$(printf '%s' "$version" | awk -F. '{print NF}')" -ne 3 ]; then if [ "$(printf '%s' "$version" | awk -F. '{print NF}')" -ne 3 ]; then
echo "::error file=version::expected MAJOR.MINOR.PATCH, got '$version'" fail version "expected MAJOR.MINOR.PATCH, got '$version'"
exit 1
fi
# kitty reads its own version from this constant, and it ends up in the
# binaries and the man pages, so the release version must not drift from it.
constants=$(sed -n 's/^version: Version = Version(\([0-9]*\), \([0-9]*\), \([0-9]*\)).*/\1.\2.\3/p' "$root/kitty/constants.py" | head -n 1)
if [ "$constants" != "$version" ]; then
echo "::error file=kitty/constants.py::kitty reports '$constants' but the version file says '$version'"
exit 1
fi fi
# makepkg names the package from pkgver, so an out-of-date PKGBUILD would # makepkg names the package from pkgver, so an out-of-date PKGBUILD would
# publish a package whose name does not match its release. # publish a package whose name does not match its release.
pkgver=$(sed -n 's/^pkgver=//p' "$root/packaging/PKGBUILD" | head -n 1) pkgver=$(sed -n 's/^pkgver=//p' "$root/packaging/PKGBUILD" | head -n 1)
if [ "$pkgver" != "$version" ]; then if [ "$pkgver" != "$version" ]; then
echo "::error file=packaging/PKGBUILD::pkgver is '$pkgver' but the version file says '$version'" fail packaging/PKGBUILD "pkgver is '$pkgver' but the version file says '$version'"
exit 1
fi fi
# The upstream kitty release follows kitty, not the fork: it lives in its own
# variable and must keep matching the constant kitty compiles into the binaries.
kitty_version=$(sed -n 's/^_kittyver=//p' "$root/packaging/PKGBUILD" | head -n 1)
constants=$(sed -n 's/^version: Version = Version(\([0-9]*\), \([0-9]*\), \([0-9]*\)).*/\1.\2.\3/p' "$root/kitty/constants.py" | head -n 1)
if [ "$constants" != "$kitty_version" ]; then
fail kitty/constants.py "kitty reports '$constants' but _kittyver in the PKGBUILD says '$kitty_version'"
fi
# The fork version is hard-coded in both front-ends, so bumping only the version
# file would ship binaries announcing the previous release.
for f in tools/cli/help.go kitty/launcher/main.c; do
if ! grep -qF "$version" "$root/$f"; then
fail "$f" "the fork version '$version' is not set in this file"
fi
done
printf '%s\n' "$version" printf '%s\n' "$version"
+1 -1
View File
@@ -1 +1 @@
0.50.0 0.1.6