CI e installatore: commenti degli script in inglese (#43)
La regola del progetto è «codice e commenti in inglese; interfaccia, documenti e messaggi in italiano», e gli script di .gitea/ (script e flussi), di installer/ e docker/entrypoint.sh avevano ancora i commenti in italiano (decisione di Alberto del 29 novembre 2026). Cambiano solo i commenti: i messaggi che una persona legge (echo, ::warning::, ::error::, nomi dei passi, note della release) restano in italiano e nessun comando cambia. I programmi awk e gli script finti delle prove erano già in inglese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f48384b7d4
commit
009e7d6710
18 files changed
+496
-495
No files matched your search
@@ -1,43 +1,43 @@
|
||||
# Rilascio a ogni tag vX.Y.Z (anche vX.Y.Z-qualcosa per un'anteprima):
|
||||
# 1. prove: il tag coincide con <Version> di Directory.Build.props, la soluzione si compila con gli avvisi come errori
|
||||
# e tutte le prove passano, nello stesso contenitore Debian 13 della verifica (Chromium e Xvfb veri) e
|
||||
# senza nessuna prova saltata. Senza prove verdi non si costruisce né si rilascia nulla;
|
||||
# 2. windows: Febe.exe in un file solo, il programma di installazione nostro (src/Febe.Installer) e lo zip portabile
|
||||
# (installer/costruisci.sh, gira su Linux con il solo .NET SDK): il cancello prima dell'immagine;
|
||||
# 3. immagine: dopo l'installatore, l'immagine Docker (le prove girano anche dentro la build), provata senza rete e
|
||||
# scansionata con Trivy come nella verifica (una CRITICAL con correzione ferma tutto), poi pubblicata sul registro
|
||||
# dei container di Gitea come <registro>/<proprietario>/febe:X.Y.Z e :latest (solo per le versioni senza
|
||||
# trattino). Il lavoro dice se l'ha pubblicata, e alla fine toglie sempre immagini, contenitori, cache e builder
|
||||
# dell'esecuzione, poi le immagini senza nome e la cache di costruzione penzolante non usata da 24 ore di tutti i
|
||||
# progetti del demone;
|
||||
# 4. release: solo dopo le prove, l'installatore e l'immagine. Ricostruisce installatore e zip dallo stesso commit con
|
||||
# lo stesso script (senza azioni non c'è un passaggio di artefatti fra i lavori che non dipenda da REGISTRY_TOKEN,
|
||||
# e la release deve uscire anche senza), poi crea la release (o la completa, se esiste già) con installatore, zip
|
||||
# portabile, modello Unraid e l'archivio per Docker Compose (compose.yml con il profilo seccomp accanto); le note
|
||||
# dicono dove sta l'immagine, o che non è stata pubblicata.
|
||||
# Release at every vX.Y.Z tag (also vX.Y.Z-something for a preview):
|
||||
# 1. prove: the tag matches <Version> in Directory.Build.props, the solution builds with warnings as errors and all
|
||||
# the tests pass, in the same Debian 13 container as the verification (real Chromium and Xvfb) and without any
|
||||
# skipped test. Without green tests nothing is built or released;
|
||||
# 2. windows: Febe.exe in a single file, our own installer (src/Febe.Installer) and the portable zip
|
||||
# (installer/costruisci.sh, runs on Linux with the .NET SDK only): the gate before the image;
|
||||
# 3. immagine: after the installer, the Docker image (the tests also run inside the build), tested without network
|
||||
# and scanned with Trivy as in the verification (a CRITICAL with a fix stops everything), then published on the
|
||||
# Gitea container registry as <registro>/<proprietario>/febe:X.Y.Z and :latest (only for versions without a
|
||||
# dash). The job says whether it published it, and at the end it always removes the run's images, containers,
|
||||
# cache and builder, then the unnamed images and the dangling build cache unused for 24 hours of all the
|
||||
# daemon's projects;
|
||||
# 4. release: only after the tests, the installer and the image. It rebuilds installer and zip from the same commit
|
||||
# with the same script (without actions there is no way to pass artifacts between jobs that does not depend on
|
||||
# REGISTRY_TOKEN, and the release must come out without it too), then creates the release (or completes it, if
|
||||
# it already exists) with installer, portable zip, Unraid template and the Docker Compose archive (compose.yml
|
||||
# with the seccomp profile next to it); the notes say where the image is, or that it was not published.
|
||||
#
|
||||
# Niente azioni, come nella verifica (decisione del 18 novembre 2026): sorgenti con git e il gettone del lavoro, SDK con
|
||||
# .gitea/scripts/dotnet.sh, builder buildx con costruisci-immagine.sh builder, risultati delle prove e rapporto di Trivy
|
||||
# nel pacchetto generico febe-ci (versione <versione>-rilascio.<numero>, con REGISTRY_TOKEN; artefatti.sh).
|
||||
# No actions, as in the verification (decision of 18 November 2026): sources with git and the job token, SDK with
|
||||
# .gitea/scripts/dotnet.sh, buildx builder with costruisci-immagine.sh builder, test results and Trivy report in the
|
||||
# generic package febe-ci (version <versione>-rilascio.<numero>, with REGISTRY_TOKEN; artefatti.sh).
|
||||
#
|
||||
# Segreto del repository (Impostazioni ▸ Actions ▸ Segreti): REGISTRY_TOKEN, un token dell'utente con i permessi
|
||||
# «package: read and write». Senza, l'immagine si costruisce e si prova ma non si pubblica: la release esce lo stesso,
|
||||
# con l'installatore per Windows, e le sue note dicono che l'immagine di questa versione non c'è. Aggiunto il segreto,
|
||||
# si rilancia il flusso del tag: l'immagine si pubblica e le note della release si correggono.
|
||||
# Variabile facoltativa (Impostazioni ▸ Actions ▸ Variabili): REGISTRY, il nome del registro come lo raggiunge il
|
||||
# runner (per esempio 192.168.30.23:3000); se manca si usa l'host dell'indirizzo del server Gitea (il suo ROOT_URL).
|
||||
# Il registro risponde in HTTP: la pubblicazione passa da buildx con un builder proprio (docker-container) a cui la
|
||||
# configurazione di buildkit dice che quel registro è in HTTP e insicuro, così non serve che il Docker del runner lo
|
||||
# abbia fra gli insecure-registries. Le credenziali vanno nella configurazione del client Docker, senza «docker login»
|
||||
# (che passerebbe dal demone, e il demone proverebbe HTTPS).
|
||||
# Repository secret (Impostazioni ▸ Actions ▸ Segreti): REGISTRY_TOKEN, a user token with the permissions
|
||||
# «package: read and write». Without it, the image is built and tested but not published: the release comes out
|
||||
# anyway, with the Windows installer, and its notes say the image of this version is missing. Once the secret is
|
||||
# added, the tag's workflow is run again: the image is published and the release notes are corrected.
|
||||
# Optional variable (Impostazioni ▸ Actions ▸ Variabili): REGISTRY, the registry name as the runner reaches it (for
|
||||
# example 192.168.30.23:3000); if missing, the host of the Gitea server address (its ROOT_URL) is used.
|
||||
# The registry answers in HTTP: publishing goes through buildx with a builder of its own (docker-container) whose
|
||||
# buildkit configuration says that registry is HTTP and insecure, so the runner's Docker does not need it among its
|
||||
# insecure-registries. The credentials go into the Docker client configuration, without «docker login» (which would
|
||||
# go through the daemon, and the daemon would try HTTPS).
|
||||
name: rilascio
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
# Come la verifica e la pulizia: ogni passo con «bash -e -o pipefail», qualunque sia la shell predefinita del runner
|
||||
# o del contenitore (i Sorgenti usano gli array di bash; in un contenitore Debian la predefinita sarebbe dash).
|
||||
# Like the verification and the cleanup: every step with «bash -e -o pipefail», whatever the default shell of the
|
||||
# runner or of the container (the Sorgenti step uses bash arrays; in a Debian container the default would be dash).
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
@@ -51,9 +51,9 @@ jobs:
|
||||
prove:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
# Lo stesso ambiente delle prove della verifica: Debian 13 con Chromium e Xvfb veri e il riepilogo che non
|
||||
# ammette prove saltate. Su ubuntu-latest le prove nel browser (fra cui il ritorno dopo l'accesso, return-path.js)
|
||||
# sarebbero inconcludenti e un rilascio uscirebbe senza averle fatte.
|
||||
# The same environment as the verification tests: Debian 13 with real Chromium and Xvfb and the summary that
|
||||
# allows no skipped tests. On ubuntu-latest the browser tests (among them the return after sign-in,
|
||||
# return-path.js) would be inconclusive and a release would come out without having run them.
|
||||
container:
|
||||
image: debian:trixie
|
||||
options: --shm-size=1g
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
dotnet test tests/Febe.Tests -c Release --no-build --nologo
|
||||
--logger "trx;LogFileName=prove.trx" --results-directory out/prove
|
||||
|
||||
# Nessuna prova saltata: una prova inconcludente (per esempio senza Chromium) ferma il rilascio.
|
||||
# No skipped test: an inconclusive test (for example without Chromium) stops the release.
|
||||
- name: Riepilogo delle prove
|
||||
if: ${{ !cancelled() }}
|
||||
run: bash .gitea/scripts/riepilogo-prove.sh out/prove 0
|
||||
@@ -128,7 +128,7 @@ jobs:
|
||||
needs: prove
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
# Come l'installatore di verifica.yml: l'immagine del runner non garantisce ICU, e qui non serve.
|
||||
# Like the installer job of verifica.yml: the runner image does not guarantee ICU, and it is not needed here.
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: "true"
|
||||
steps:
|
||||
- name: Sorgenti
|
||||
@@ -163,7 +163,7 @@ jobs:
|
||||
|
||||
immagine:
|
||||
runs-on: ubuntu-latest
|
||||
# Dopo l'installatore: :X.Y.Z e :latest escono solo se anche la release potrà uscire.
|
||||
# After the installer: :X.Y.Z and :latest come out only if the release can come out too.
|
||||
needs: [prove, windows]
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
@@ -198,7 +198,7 @@ jobs:
|
||||
git checkout -q --force --detach "$GITHUB_SHA"
|
||||
git log -1 --format='Commit %h: %s'
|
||||
|
||||
# Ciò che un'esecuzione interrotta non ha potuto togliere, e un tentativo precedente di questa stessa esecuzione.
|
||||
# What an interrupted run could not remove, and an earlier attempt of this same run.
|
||||
- name: Resti di esecuzioni interrotte
|
||||
run: |
|
||||
bash .gitea/scripts/pulizia-docker.sh residui 90
|
||||
@@ -219,11 +219,11 @@ jobs:
|
||||
echo "IMAGE=$REGISTRY/$OWNER/febe" >> "$GITHUB_ENV"
|
||||
echo "immagine=$REGISTRY/$OWNER/febe" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Un builder buildx proprio, che sa che il registro di casa risponde in HTTP.
|
||||
# A buildx builder of our own, which knows that the home registry answers in HTTP.
|
||||
- name: Builder buildx dell'esecuzione
|
||||
run: bash .gitea/scripts/costruisci-immagine.sh builder "$REGISTRY"
|
||||
|
||||
# Gli stessi argomenti ed etichette della pubblicazione (costruisci-immagine.sh): quella esce dalla cache di questa.
|
||||
# The same arguments and labels as the publication (costruisci-immagine.sh): that one comes from this one's cache.
|
||||
- name: Costruzione dell'immagine (le prove girano dentro la build)
|
||||
run: |
|
||||
bash .gitea/scripts/costruisci-immagine.sh archivio "$ARCHIVIO" "$PROVA"
|
||||
@@ -267,37 +267,37 @@ jobs:
|
||||
REGISTRO_UTENTE: ${{ gitea.actor }}
|
||||
run: |
|
||||
set -eu
|
||||
# Le credenziali le mette costruisci-immagine.sh pubblica in una configurazione del client solo sua, tolta
|
||||
# alla fine: buildx le passa al builder, il demone non c'entra.
|
||||
# costruisci-immagine.sh pubblica puts the credentials in a client configuration of its own, removed at the
|
||||
# end: buildx passes them to the builder, the daemon is not involved.
|
||||
NOMI="$IMAGE:$VERSION"
|
||||
case "$VERSION" in
|
||||
*-*) echo "Versione di anteprima: :latest non si sposta." ;;
|
||||
*) NOMI="$NOMI $IMAGE:latest" ;;
|
||||
esac
|
||||
# La stessa costruzione di prima (dalla cache del builder), questa volta spinta sul registro da buildx.
|
||||
# The same build as before (from the builder's cache), this time pushed to the registry by buildx.
|
||||
bash .gitea/scripts/costruisci-immagine.sh pubblica $NOMI
|
||||
echo "pubblicata=si" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Pulizia (sempre)
|
||||
if: always()
|
||||
run: |
|
||||
# La configurazione del client con le credenziali, se un'interruzione ha saltato la trap di chi l'ha scritta.
|
||||
# The client configuration with the credentials, if an interruption skipped the trap of whoever wrote it.
|
||||
rm -rf "${RUNNER_TEMP:-/tmp}/febe-docker-$ESECUZIONE"
|
||||
if [ -n "${ARCHIVIO:-}" ]; then rm -f "$ARCHIVIO"; fi
|
||||
bash .gitea/scripts/pulizia-docker.sh esecuzione "$ESECUZIONE"
|
||||
# Poi, per tutti i progetti del demone, ciò che nessuno usa: immagini senza nome e cache di costruzione
|
||||
# penzolante non usata da 24 ore. Non fa mai fallire il lavoro.
|
||||
# Then, for all the daemon's projects, what nobody uses: unnamed images and dangling build cache unused for
|
||||
# 24 hours. It never fails the job.
|
||||
bash .gitea/scripts/pulizia-docker.sh penzolanti || echo "::warning::La pulizia di ciò che nessuno usa non è riuscita."
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
# Le prove sono verdi, l'installatore c'è e l'immagine si è costruita: pubblicata, o non pubblicata per la sola
|
||||
# mancanza del segreto (il lavoro «immagine» lo dice e le note lo riportano). Se la costruzione, la prova del
|
||||
# contenitore, la scansione o la spinta sul registro falliscono, non esce nessuna release.
|
||||
# The tests are green, the installer is there and the image was built: published, or not published only because
|
||||
# the secret is missing (the «immagine» job says so and the notes report it). If the build, the container test,
|
||||
# the scan or the push to the registry fail, no release comes out.
|
||||
needs: [prove, windows, immagine]
|
||||
timeout-minutes: 40
|
||||
env:
|
||||
# Come «windows»: l'immagine del runner non garantisce ICU, e per costruire l'installatore non serve.
|
||||
# Like «windows»: the runner image does not guarantee ICU, and building the installer does not need it.
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: "true"
|
||||
steps:
|
||||
- name: Sorgenti
|
||||
@@ -324,7 +324,7 @@ jobs:
|
||||
- name: SDK .NET 10
|
||||
run: bash .gitea/scripts/dotnet.sh 10.0
|
||||
|
||||
# Lo stesso commit e lo stesso script del lavoro «windows», che ha già fatto da cancello prima dell'immagine.
|
||||
# The same commit and the same script as the «windows» job, which already acted as the gate before the image.
|
||||
- name: Febe.exe, programma di installazione e zip portabile per la release
|
||||
run: bash installer/costruisci.sh "${GITHUB_REF_NAME#v}"
|
||||
|
||||
@@ -339,7 +339,7 @@ jobs:
|
||||
set -eu
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
VERSION="${TAG#v}"
|
||||
case "$VERSION" in *-*|0.*) PRE=true ;; *) PRE=false ;; esac # le versioni 0.x sono anteprime
|
||||
case "$VERSION" in *-*|0.*) PRE=true ;; *) PRE=false ;; esac # 0.x versions are previews
|
||||
NOTE=$(awk -v v="$VERSION" '/^## /{p=($2==v)} p' CHANGELOG.md || true)
|
||||
[ -n "$NOTE" ] || NOTE="Febe $VERSION"
|
||||
if [ "$PUBBLICATA" = "si" ]; then
|
||||
@@ -353,8 +353,8 @@ jobs:
|
||||
fi
|
||||
NOTE=$(printf '%s\n\n### Immagine Docker\n\n%s\n' "$NOTE" "$IMMAGINE_NOTA")
|
||||
|
||||
# JSON letto e scritto con .gitea/scripts/json.sh (awk), niente jq. Le risposte di Gitea in un file: il
|
||||
# lettore legge file, non un flusso.
|
||||
# JSON read and written with .gitea/scripts/json.sh (awk), no jq. Gitea's responses go to a file: the reader
|
||||
# reads files, not a stream.
|
||||
RISPOSTA="${RUNNER_TEMP:-/tmp}/febe-release-${GITHUB_RUN_ID:-0}.json"
|
||||
ID=""
|
||||
if curl -sf -H "Authorization: token $TOKEN" "$API/releases/tags/$TAG" -o "$RISPOSTA"; then
|
||||
@@ -371,7 +371,7 @@ jobs:
|
||||
echo "Release $TAG creata (id $ID)"
|
||||
else
|
||||
[[ "$ID" =~ ^[0-9]+$ ]] || { echo "Identificativo della release inatteso: «$ID»." >&2; exit 1; }
|
||||
# Le note dicono come è andata questa volta (per esempio: l'immagine ora è pubblicata).
|
||||
# The notes say how it went this time (for example: the image is now published).
|
||||
printf '{"body":%s}' "$(bash .gitea/scripts/json.sh stringa "$NOTE")" \
|
||||
| curl -sf -X PATCH -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
|
||||
--data-binary @- "$API/releases/$ID" > /dev/null
|
||||
@@ -379,7 +379,7 @@ jobs:
|
||||
fi
|
||||
|
||||
cp docker/unraid/febe.xml "out/febe-unraid-$VERSION.xml"
|
||||
# compose.yml indica il profilo seccomp con un percorso relativo: l'archivio li porta insieme.
|
||||
# compose.yml points to the seccomp profile with a relative path: the archive carries them together.
|
||||
COMPOSE="out/febe-compose-$VERSION"
|
||||
rm -rf "$COMPOSE"
|
||||
mkdir -p "$COMPOSE/chromium"
|
||||
|
||||
Reference in new issue
Block a user