From d7dab43e49840805b3bf80104a98a14d2cf8580a Mon Sep 17 00:00:00 2001 From: AruNi_Lu Date: Tue, 3 Mar 2026 21:19:12 +0800 Subject: [PATCH 1/6] fix(desktop): enable tauri bundle artifacts in release --- apps/desktop/src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 5a83f5788..8d4c48f6a 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -36,7 +36,7 @@ } }, "bundle": { - "active": false, + "active": true, "targets": "all", "icon": ["icons/icon.svg"], "externalBin": [ From 254144ae4b0059dcdb27db4573c0063dfd31cc5e Mon Sep 17 00:00:00 2001 From: AruNi_Lu Date: Tue, 3 Mar 2026 21:39:58 +0800 Subject: [PATCH 2/6] fix(ci): support desktop tag variants for release trigger --- .github/workflows/release-desktop.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index aa00fa147..5a81ca3c8 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -4,6 +4,8 @@ on: push: tags: - "desktop-v*" + - "DeskTop-v*" + - "Desktop-v*" jobs: release: @@ -61,8 +63,8 @@ jobs: TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} with: projectPath: apps/desktop - tagName: desktop-v__VERSION__ - releaseName: Atmos Desktop v__VERSION__ + tagName: ${{ github.ref_name }} + releaseName: Atmos Desktop ${{ github.ref_name }} releaseDraft: true prerelease: false args: ${{ matrix.args }} From e839e16aa509b17e217f68e0c5c767adfbe65b56 Mon Sep 17 00:00:00 2001 From: AruNi_Lu Date: Tue, 3 Mar 2026 21:40:06 +0800 Subject: [PATCH 3/6] fix(ci): run desktop pipeline on PR and only release on tags --- .github/workflows/release-desktop.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 5a81ca3c8..f632db0c1 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -6,6 +6,11 @@ on: - "desktop-v*" - "DeskTop-v*" - "Desktop-v*" + pull_request: + paths: + - "apps/desktop/**" + - ".github/workflows/release-desktop.yml" + workflow_dispatch: jobs: release: @@ -55,7 +60,12 @@ jobs: if [ "${{ matrix.platform }}" = "windows-latest" ]; then EXT=".exe"; fi mkdir -p apps/desktop/src-tauri/binaries cp target/${{ matrix.target }}/release/api${EXT} apps/desktop/src-tauri/binaries/api-${{ matrix.target }}${EXT} + - name: Build Tauri app (PR validation) + if: github.event_name == 'pull_request' + working-directory: apps/desktop + run: bun tauri build ${{ matrix.args }} --no-bundle - name: Build and release Tauri app + if: startsWith(github.ref, 'refs/tags/') uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 68b72aacdd5b780b6c21c2d4499d0277a45e3da3 Mon Sep 17 00:00:00 2001 From: AruNi_Lu Date: Tue, 3 Mar 2026 22:13:55 +0800 Subject: [PATCH 4/6] fix(desktop): make tauri beforeBuildCommand cross-platform --- apps/desktop/package.json | 2 +- apps/desktop/scripts/before-build.mjs | 72 ++++++++++++++++++++ apps/desktop/src-tauri/tauri.conf.json | 2 +- apps/desktop/src-tauri/tauri.debug.conf.json | 2 +- 4 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 apps/desktop/scripts/before-build.mjs diff --git a/apps/desktop/package.json b/apps/desktop/package.json index fce2e349d..a7eb5f8a9 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -7,7 +7,7 @@ "tauri": "tauri", "dev": "tauri dev", "build": "tauri build", - "prepare:sidecar": "bash ./scripts/prepare-sidecar.sh" + "prepare:sidecar": "node ./scripts/before-build.mjs" }, "devDependencies": { "@tauri-apps/cli": "^2.0.0" diff --git a/apps/desktop/scripts/before-build.mjs b/apps/desktop/scripts/before-build.mjs new file mode 100644 index 000000000..9e2a60ddd --- /dev/null +++ b/apps/desktop/scripts/before-build.mjs @@ -0,0 +1,72 @@ +import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs"; +import { join, resolve } from "node:path"; +import { spawnSync } from "node:child_process"; + +const rootDir = resolve(import.meta.dirname, "../../.."); + +function run(command, args, options = {}) { + const result = spawnSync(command, args, { + stdio: "inherit", + cwd: rootDir, + env: process.env, + shell: process.platform === "win32", + ...options, + }); + + if (result.status !== 0) { + process.exit(result.status ?? 1); + } +} + +run("bun", ["--filter", "web", "build"], { + env: { + ...process.env, + BUILD_TARGET: "desktop", + }, +}); + +let targetTriple = process.env.TARGET_TRIPLE; +if (!targetTriple) { + const rustc = spawnSync("rustc", ["-vV"], { + cwd: rootDir, + encoding: "utf-8", + shell: process.platform === "win32", + }); + + if (rustc.status !== 0) { + process.exit(rustc.status ?? 1); + } + + const hostLine = rustc.stdout + .split("\n") + .find((line) => line.startsWith("host:")); + + if (!hostLine) { + console.error("Unable to detect rust host triple from `rustc -vV`."); + process.exit(1); + } + + targetTriple = hostLine.replace("host:", "").trim(); +} + +run("cargo", ["build", "--release", "--bin", "api", "--target", targetTriple]); + +const binExt = targetTriple.includes("windows") ? ".exe" : ""; +const binariesDir = join(rootDir, "apps/desktop/src-tauri/binaries"); +mkdirSync(binariesDir, { recursive: true }); + +const fromSidecar = join(rootDir, `target/${targetTriple}/release/api${binExt}`); +const toSidecar = join(binariesDir, `api-${targetTriple}${binExt}`); +cpSync(fromSidecar, toSidecar); +console.log(`Prepared sidecar: ${toSidecar}`); + +const webOut = join(rootDir, "apps/web/out"); +const sidecarWebOut = join(binariesDir, "web-out"); + +if (existsSync(webOut)) { + rmSync(sidecarWebOut, { recursive: true, force: true }); + cpSync(webOut, sidecarWebOut, { recursive: true }); + console.log(`Copied web static export to: ${sidecarWebOut}`); +} else { + console.warn(`Warning: ${webOut} not found, skipping web static copy`); +} diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 8d4c48f6a..60c2053a5 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -5,7 +5,7 @@ "identifier": "com.atmos.desktop", "build": { "beforeDevCommand": "bun --filter web dev", - "beforeBuildCommand": "BUILD_TARGET=desktop bun --filter web build && bash ./scripts/prepare-sidecar.sh", + "beforeBuildCommand": "node ./scripts/before-build.mjs", "devUrl": "http://localhost:3030", "frontendDist": "../../web/out" }, diff --git a/apps/desktop/src-tauri/tauri.debug.conf.json b/apps/desktop/src-tauri/tauri.debug.conf.json index b4f93add3..f7c510330 100644 --- a/apps/desktop/src-tauri/tauri.debug.conf.json +++ b/apps/desktop/src-tauri/tauri.debug.conf.json @@ -6,7 +6,7 @@ "build": { "beforeDevCommand": "", "devUrl": "http://localhost:3030", - "beforeBuildCommand": "BUILD_TARGET=desktop bun --filter web build && bash ./scripts/prepare-sidecar.sh", + "beforeBuildCommand": "node ./scripts/before-build.mjs", "frontendDist": "../../web/out" }, "app": { From b5870a33cd2fde115dfd2770bb6ebf932f0cf7ea Mon Sep 17 00:00:00 2001 From: AruNi_Lu Date: Tue, 3 Mar 2026 23:25:43 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20release-desktop.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- .github/workflows/release-desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index f632db0c1..75787f1bf 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -74,7 +74,7 @@ jobs: with: projectPath: apps/desktop tagName: ${{ github.ref_name }} - releaseName: Atmos Desktop ${{ github.ref_name }} + releaseName: Atmos Desktop v__VERSION__ releaseDraft: true prerelease: false args: ${{ matrix.args }} From 25b305d90ecf3a8617727e8f75578350ece50c7f Mon Sep 17 00:00:00 2001 From: "cubic-dev-ai[bot]" <1082092+cubic-dev-ai[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:28:22 +0000 Subject: [PATCH 6/6] fix(ci): include workflow_dispatch in desktop PR validation condition When workflow_dispatch was triggered from a branch, neither the pull_request nor the tags condition matched, so the workflow would run all setup steps but skip both Tauri build steps entirely. Extend the PR validation condition to also cover workflow_dispatch so manual dispatches run a --no-bundle validation build. --- .github/workflows/release-desktop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 75787f1bf..c94fd2feb 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -60,8 +60,8 @@ jobs: if [ "${{ matrix.platform }}" = "windows-latest" ]; then EXT=".exe"; fi mkdir -p apps/desktop/src-tauri/binaries cp target/${{ matrix.target }}/release/api${EXT} apps/desktop/src-tauri/binaries/api-${{ matrix.target }}${EXT} - - name: Build Tauri app (PR validation) - if: github.event_name == 'pull_request' + - name: Build Tauri app (PR / manual validation) + if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' working-directory: apps/desktop run: bun tauri build ${{ matrix.args }} --no-bundle - name: Build and release Tauri app