From 148aefb1e2c7276e6e553e3e023b716f214703ed Mon Sep 17 00:00:00 2001 From: Daniel Gorgonha Date: Sun, 2 Aug 2026 21:34:33 -0300 Subject: [PATCH] fix(desktop-ci): build the UI in the workflow, empty beforeBuildCommand tauri-action runs beforeBuildCommand from a different cwd than a local tauri build (it ran it from ui/, so 'npm --prefix ui' became ui/ui and failed). No single relative --prefix works for both, so decouple: beforeBuildCommand is empty and the workflow builds ui/dist explicitly from the repo root before tauri-action bundles it. Local 'tauri build' now expects the UI built first (npm --prefix ui run build); 'tauri dev' is unchanged. --- .github/workflows/desktop-release.yml | 7 +++++++ src-tauri/tauri.conf.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml index cdf3f3f..9f30d79 100644 --- a/.github/workflows/desktop-release.yml +++ b/.github/workflows/desktop-release.yml @@ -49,6 +49,13 @@ jobs: - name: Frontend deps run: npm --prefix ui ci + # Build the UI explicitly here (into ui/dist) rather than via tauri.conf's + # beforeBuildCommand: tauri-action runs before-commands from a different cwd than a local + # `tauri build`, and no single relative --prefix works for both. So beforeBuildCommand is + # empty and the frontend is built here, cwd-unambiguously, from the repo root. + - name: Build UI + run: npm --prefix ui run build + - name: Build + attach installers uses: tauri-apps/tauri-action@v0 env: diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 25e8a79..4de6254 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "frontendDist": "../ui/dist", "devUrl": "http://localhost:5173", "beforeDevCommand": "npm --prefix ui run dev", - "beforeBuildCommand": "npm --prefix ui run build" + "beforeBuildCommand": "" }, "app": { "windows": [