Compare commits
1
Commits
v0.1.7
..
25840c6ce1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25840c6ce1
|
No files matched your search
@@ -154,6 +154,23 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "release_id=$release_id"
|
echo "release_id=$release_id"
|
||||||
|
|
||||||
|
# A pacman version is immutable: clients cache the package by name and
|
||||||
|
# repo.laxacube.ch serves it through a CDN, so a rebuild published
|
||||||
|
# under the same version leaves those caches holding bytes the index
|
||||||
|
# no longer matches, and pacman reports the file as corrupted. A
|
||||||
|
# re-run that rebuilds identical bytes stays allowed.
|
||||||
|
local_sha256="$(cut -d' ' -f1 "$PACKAGE_FILE.sha256")"
|
||||||
|
published_sha256=""
|
||||||
|
sha_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/$tag/$PACKAGE_NAME.sha256"
|
||||||
|
if curl -fsSL "$sha_url" -o "$RUNNER_TEMP/published.sha256"; then
|
||||||
|
published_sha256="$(cut -d' ' -f1 "$RUNNER_TEMP/published.sha256")"
|
||||||
|
fi
|
||||||
|
if [ -n "$published_sha256" ] && [ "$published_sha256" != "$local_sha256" ]; then
|
||||||
|
echo "::error::$PACKAGE_NAME is already published with sha256 $published_sha256 but this build is $local_sha256"
|
||||||
|
echo "::error::bump pkgrel in packaging/PKGBUILD so the rebuild is published as its own version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# A re-run must replace its own artefacts instead of failing on them.
|
# A re-run must replace its own artefacts instead of failing on them.
|
||||||
assets="$(curl -sS -H "$auth" "$api/releases/$release_id/assets")"
|
assets="$(curl -sS -H "$auth" "$api/releases/$release_id/assets")"
|
||||||
attach() {
|
attach() {
|
||||||
@@ -194,15 +211,19 @@ jobs:
|
|||||||
-H 'Content-Type: application/octet-stream' \
|
-H 'Content-Type: application/octet-stream' \
|
||||||
--data-binary "@$PACKAGE_FILE"
|
--data-binary "@$PACKAGE_FILE"
|
||||||
echo
|
echo
|
||||||
# The index is rebuilt server-side, so wait for the package before
|
# The index is rebuilt server-side and the file is served through a
|
||||||
# reporting success.
|
# CDN, so a HEAD is not enough: the index and the file can disagree
|
||||||
|
# for as long as the CDN caches the previous build under this name,
|
||||||
|
# and the checksum is exactly what pacman verifies before installing.
|
||||||
url="https://repo.laxacube.ch/x86_64/$PACKAGE_NAME"
|
url="https://repo.laxacube.ch/x86_64/$PACKAGE_NAME"
|
||||||
|
expected="$(cut -d' ' -f1 "$PACKAGE_FILE.sha256")"
|
||||||
for _ in 1 2 3 4 5 6; do
|
for _ in 1 2 3 4 5 6; do
|
||||||
if curl -fsSI "$url" > /dev/null; then
|
if [ "$(curl -fsSL "$url" | sha256sum | cut -d' ' -f1)" = "$expected" ]; then
|
||||||
echo "published $url"
|
echo "published $url"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
echo "::error::the upload was accepted but $url is not served yet"
|
echo "::error::$url does not serve this build (expected sha256 $expected)"
|
||||||
|
echo "::error::the CDN is probably still caching an older file under this name: purge it before re-running"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -320,8 +320,11 @@ contrôles sur chaque PR et chaque push sur `main` qui ne modifie pas que
|
|||||||
Pour reconstruire la même version du fork (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.1.7-2` remplace alors le
|
(*Actions → Release → Run workflow*) : le paquet `0.1.7-2` remplace alors le
|
||||||
`0.1.7-1`. Une nouvelle version du fork demande `version`, `pkgver` et les deux
|
`0.1.7-1`. Une version déjà publiée n'est jamais réécrite avec un autre build :
|
||||||
front-ends, avec `pkgrel=1` ; pour suivre une nouvelle version de kitty, mettre
|
le workflow refuse de remplacer un paquet dont l'empreinte a changé et demande
|
||||||
|
d'incrémenter `pkgrel`, sinon les caches (CDN, pacman) servent un fichier qui ne
|
||||||
|
correspond plus à la base. Une nouvelle version du fork demande `version`,
|
||||||
|
`pkgver` et les deux front-ends, avec `pkgrel=1` ; pour suivre une nouvelle version de kitty, mettre
|
||||||
à jour `_kittyver` et `kitty/constants.py`. La publication vers
|
à jour `_kittyver` et `kitty/constants.py`. La publication vers
|
||||||
`repo.laxacube.ch` utilise le
|
`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
|
||||||
|
|||||||
@@ -91,6 +91,15 @@ fork, incrémentez `pkgrel` ici et lancez le workflow manuellement ; le paquet
|
|||||||
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`.
|
||||||
|
|
||||||
|
Une version publiée n'est jamais réécrite : deux builds du même commit ne sont
|
||||||
|
pas identiques à l'octet près, et le CDN comme le cache pacman gardent le fichier
|
||||||
|
sous son nom, donc republier `0.1.7-1` avec un autre contenu donne des caches qui
|
||||||
|
désaccordent avec la base et pacman rejette le téléchargement (`paquet non valide
|
||||||
|
ou corrompu`). Le workflow refuse ce cas et demande d'incrémenter `pkgrel`.
|
||||||
|
Après l'envoi, il relit aussi le paquet servi et compare son `sha256` à celui du
|
||||||
|
build, pour ne pas annoncer une publication que les clients ne peuvent pas
|
||||||
|
installer.
|
||||||
|
|
||||||
`pkgver` est la version du fork FWS (fichier `version` à la racine), pas celle
|
`pkgver` est la version du fork FWS (fichier `version` à la racine), pas celle
|
||||||
de kitty : la version amont embarquée est dans `_kittyver`.
|
de kitty : la version amont embarquée est dans `_kittyver`.
|
||||||
`packaging/check-version.sh` vérifie avant le build que `version` et `pkgver`
|
`packaging/check-version.sh` vérifie avant le build que `version` et `pkgver`
|
||||||
|
|||||||
Reference in new issue
Block a user