From 386633b092476e16bded41579922ac38e1beb6e9 Mon Sep 17 00:00:00 2001 From: BlackAngelTVdev Date: Fri, 4 Dec 2026 12:42:10 +0100 Subject: [PATCH] feat(release): publish an ISO that was built somewhere else The build needs mount() and loop devices, which a CI job does not always get, while the publication only needs the API tokens. --iso takes the artefact as an argument so an image built on the usual host can be released from any machine. --- release.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 1f98629..96be3e0 100755 --- a/release.sh +++ b/release.sh @@ -43,6 +43,7 @@ GH_UPLOAD="${FWS_GITHUB_UPLOAD:-https://uploads.github.com}" TOKENS_FILE="${FWS_RELEASE_TOKENS_FILE:-$HOME/nottte.txt}" VARIANT="" +ISO_ARG="" SKIP_BUILD=0 DRY_RUN=0 FORCE=0 @@ -54,6 +55,10 @@ Usage : ./release.sh [options] --variant Variante de l'ISO (cli, kde, gnome…). Demandée si absente. --skip-build Réutilise l'ISO déjà présente dans out/ (retry d'upload). + --iso Publie cette ISO-là au lieu de la chercher dans out/. + Utile quand le build se fait sur une machine et la + publication sur une autre (ou depuis une CI sans + privilèges, cf. workflow release). --force Publie même sans changement de ligne de version. --dry-run N'exécute ni le build ni les appels réseau ; montre le plan. --check Décide seulement s'il faut publier (code retour 0 dans tous @@ -73,6 +78,8 @@ while [ $# -gt 0 ]; do --variant) VARIANT="${2:-}"; [ -n "$VARIANT" ] || die "--variant attend un nom."; shift 2 ;; --variant=*) VARIANT="${1#*=}"; shift ;; --skip-build) SKIP_BUILD=1; shift ;; + --iso) ISO_ARG="${2:-}"; [ -n "$ISO_ARG" ] || die "--iso attend un chemin."; SKIP_BUILD=1; shift 2 ;; + --iso=*) ISO_ARG="${1#*=}"; SKIP_BUILD=1; shift ;; --force) FORCE=1; shift ;; --dry-run) DRY_RUN=1; shift ;; --check) CHECK=1; shift ;; @@ -270,7 +277,13 @@ fi # ─── ISO produite ──────────────────────────────────────────────────────────── ISO_DIR="$WORK_DIR/out/v${MAJOR}/v${MAJOR}.${MINOR}" ISO_PATH="" -if [ -n "$VARIANT" ]; then +if [ -n "$ISO_ARG" ]; then + # An ISO built elsewhere: resolve it against the caller's cwd before any + # cd, and let the name stay whatever the build produced. + [ -f "$ISO_ARG" ] || die "ISO introuvable : $ISO_ARG" + ISO_PATH="$(cd "$(dirname "$ISO_ARG")" && pwd)/$(basename "$ISO_ARG")" +fi +if [ -z "$ISO_PATH" ] && [ -n "$VARIANT" ]; then # Newest first: a retry the day after must pick the last build, not an old one. ISO_PATH="$(ls -1t "$ISO_DIR"/fws-"$VERSION"-"$VARIANT"-*.iso 2>/dev/null | head -1 || true)" fi