From a6ffe05150fce99353003182899f99d28a6098e3 Mon Sep 17 00:00:00 2001 From: Schalli Date: Wed, 16 Sep 2026 16:21:09 +0200 Subject: [PATCH] =?UTF-8?q?feat(18-02):=20Task=201=20=E2=80=94=20Job=20des?= =?UTF-8?q?ktop=20(Linux-AppImage)=20und=20Uebergabe=20an=20publish=20per?= =?UTF-8?q?=20actions/cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Neuer CI-Job desktop nach test, laeuft auf main und bei Tags v* (Systemabhaengigkeiten, Rust-Toolchain per rustup, Cargo-Zwischenspeicher, Version setzen, cargo check/clippy, alte Bundles entfernen, Linux-AppImage bauen, desktop-collect.sh --require linux, Uebergabe per actions/cache/save mit Schluessel desktop-dist-${{ gitea.sha }}) - publish haengt jetzt an desktop (needs: desktop) statt an test, holt die Pakete per actions/cache/restore mit fail-on-cache-miss: true und prueft das Manifest hart - publish-images.sh bricht im echten Baupfad ohne desktop-dist/manifest.json ab (zweites Netz gegen einen Cache-Fehlschlag, D-08/Pitfall 1) Co-Authored-By: Claude Opus 5 (1M context) --- .gitea/scripts/publish-images.sh | 11 +++++ .gitea/workflows/ci.yml | 85 +++++++++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.gitea/scripts/publish-images.sh b/.gitea/scripts/publish-images.sh index 356e60f..cccc524 100755 --- a/.gitea/scripts/publish-images.sh +++ b/.gitea/scripts/publish-images.sh @@ -19,6 +19,12 @@ # die volle Historie samt Tags (fetch-depth: 0 im Workflow). # # Dieses Skript kennt kein Secret und gibt keines aus; der Registry-Login bleibt im Workflow. +# +# Phase 18 (18-02): Die Desktop-Pakete kommen aus dem vorgeschalteten Job `desktop` +# und werden per actions/cache als desktop-dist/ uebergeben; das Dockerfile der API +# kopiert desktop-dist/ ins Abbild. Ohne desktop-dist/manifest.json bricht dieses +# Skript im echten Baupfad hart ab -- zweites Netz gegen Pitfall 1 (Cache-Fehlschlag), +# der Workflow selbst prueft es bereits vor diesem Schritt. set -eu REGISTRY="${REGISTRY:-localhost:3002/schalli/tessera-ctl}" @@ -54,6 +60,11 @@ if [ "${1:-}" = "--print-plan" ]; then exit 0 fi +if [ ! -f desktop-dist/manifest.json ]; then + echo "desktop-dist/manifest.json fehlt -- kein Abbild ohne Desktop-Pakete (Pitfall 1)." >&2 + exit 1 +fi + for IMG in web api; do docker build -t "$REGISTRY/$IMG:$APP_CHANNEL" \ --build-arg APP_VERSION="$APP_VERSION" \ diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 41fc4b5..2250ea7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,6 +2,8 @@ # Tag v* -> Kanal live (Etiketten live + vX.Y.Z); Zweig live ohne Tag wird nur geprueft. # Die Entscheidung trifft .gitea/scripts/publish-images.sh anhand GITHUB_REF. # Tag v* (quick-260916-dcz): zusaetzlich Gitea-Release aus dem CHANGELOG.md-Abschnitt (publish-release.sh). +# Phase 18 (18-02): Job `desktop` baut vor `publish` das Linux-AppImage (Windows-NSIS +# folgt in 18-05) und uebergibt es per actions/cache; `publish` bricht ohne Manifest ab. name: Tessera CI/CD on: @@ -52,16 +54,97 @@ jobs: - name: Run tests run: pnpm test + desktop: + name: Desktop-Pakete bauen + runs-on: ubuntu-latest + needs: test + if: gitea.ref == 'refs/heads/main' || startsWith(gitea.ref, 'refs/tags/v') + steps: + # Ohne volle Historie und Tags liefert `git describe` nichts -- Pflicht fuer die Version. + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 24 + + - name: Enable pnpm via corepack + run: corepack enable && corepack prepare pnpm@9.15.0 --activate + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Systemabhaengigkeiten + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \ + libayatana-appindicator3-dev librsvg2-dev \ + libgtk-3-dev libssl-dev patchelf file xdg-utils + + - name: Rust-Toolchain + run: | + curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + + - name: Cargo-Zwischenspeicher + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + ~/.cache/tauri + apps/desktop/src-tauri/target + key: desktop-cargo-${{ hashFiles('apps/desktop/src-tauri/Cargo.lock') }} + restore-keys: desktop-cargo- + + - name: Version setzen + run: sh .gitea/scripts/desktop-version.sh + + - name: Rust pruefen + working-directory: apps/desktop/src-tauri + run: | + cargo check + cargo clippy + + - name: Alte Bundles entfernen + run: rm -rf apps/desktop/src-tauri/target/release/bundle + + - name: Linux-AppImage bauen + run: pnpm --filter @tessera/desktop exec tauri build --bundles appimage + + - name: Pakete einsammeln + run: sh .gitea/scripts/desktop-collect.sh --require linux + + - name: Uebergabe an publish + uses: actions/cache/save@v4 + with: + path: desktop-dist + key: desktop-dist-${{ gitea.sha }} + publish: name: Build & Publish Images runs-on: ubuntu-latest - needs: test + needs: desktop steps: # Ohne volle Historie und Tags liefert `git describe` nichts -- Pflicht fuer den Stempel. - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Desktop-Pakete aus dem Zwischenspeicher holen + uses: actions/cache/restore@v4 + with: + path: desktop-dist + key: desktop-dist-${{ gitea.sha }} + fail-on-cache-miss: true + + - name: Pakete pruefen + run: | + test -f desktop-dist/manifest.json + jq . desktop-dist/manifest.json + - name: Log in to Gitea Container Registry run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login localhost:3002 -u ${{ gitea.actor }} --password-stdin