fix(desktop): enable Tauri bundling for desktop release - #11
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSwitched Tauri pre-build from a shell pipeline to a Node script that builds web and API sidecar artifacts, enabled Tauri bundling, and expanded CI release workflow triggers and PR-validation build steps. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GH as GitHub Actions
participant Bun as Bun (web build)
participant Rust as rustc/cargo
participant FS as Filesystem
Dev->>GH: push PR / tag / manual dispatch
GH->>GH: choose workflow (PR validation or release)
GH->>Bun: invoke `node ./scripts/before-build.mjs` -> run `BUILD_TARGET=desktop bun --filter web build`
Bun-->>GH: produce web output (apps/web/out)
GH->>Rust: probe `rustc -vV` or read $TARGET_TRIPLE
Rust-->>GH: return host target triple
GH->>Rust: run `cargo build --release --target {triple}`
Rust-->>GH: produce API binary (target/{triple}/release/api[.exe])
GH->>FS: create sidecar dir, copy `api-{triple}[.exe]` and optionally `web-out`
FS-->>GH: sidecar artifacts ready for packaging/publishing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/release-desktop.yml">
<violation number="1" location=".github/workflows/release-desktop.yml:67">
P2: Release name will be redundant: `Atmos Desktop desktop-v1.0.0`. The `${{ github.ref_name }}` includes the full tag (e.g. `desktop-v1.0.0`), so the word "desktop" appears twice. The previous `Atmos Desktop v__VERSION__` was correct — tauri-action's `__VERSION__` placeholder is replaced with the version from `tauri.conf.json`, producing a clean name like `Atmos Desktop v1.0.0`. Consider keeping `__VERSION__` for `releaseName` while using `${{ github.ref_name }}` for `tagName` if needed.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/release-desktop.yml (1)
7-8: Consider using a single, consistent tag pattern.Having three case variants (
desktop-v*,DeskTop-v*,Desktop-v*) may indicate inconsistent tagging practices. A simpler approach would be to standardize on one pattern (e.g.,desktop-v*) and enforce it via documentation or branch protection rules.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/release-desktop.yml around lines 7 - 8, Standardize the release tag pattern by removing the mixed-case variants and keeping a single consistent pattern (e.g., replace "DeskTop-v*" and "Desktop-v*" with just "desktop-v*"); update any places in the workflow where those three entries appear so only the chosen pattern ("desktop-v*") remains and adjust any docs or branch rules that reference the other variants to use the single pattern.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/release-desktop.yml:
- Around line 9-13: The workflow currently adds workflow_dispatch but the
PR-only and tag-only conditions (checks referencing github.event_name ==
'pull_request' and startsWith(github.ref, 'refs/tags/')) prevent any
build/release steps from running on manual dispatch; either remove
workflow_dispatch if manual runs are not desired, or update the step/job
conditions (e.g., in the release and PR validation jobs/steps that reference
github.event_name and github.ref) to include a branch for manual runs (check for
github.event_name == 'workflow_dispatch' or a specific input like
github.event.inputs.publish == 'true') so that the intended build/release jobs
(the sidecar build and release steps) run when workflow_dispatch is used.
---
Nitpick comments:
In @.github/workflows/release-desktop.yml:
- Around line 7-8: Standardize the release tag pattern by removing the
mixed-case variants and keeping a single consistent pattern (e.g., replace
"DeskTop-v*" and "Desktop-v*" with just "desktop-v*"); update any places in the
workflow where those three entries appear so only the chosen pattern
("desktop-v*") remains and adjust any docs or branch rules that reference the
other variants to use the single pattern.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/desktop/src-tauri/tauri.debug.conf.json (1)
9-9: Consider using the package script to avoid command duplication.Using
npm run prepare:sidecarhere keeps one canonical command path (package.json) and reduces drift between configs.Proposed tweak
- "beforeBuildCommand": "node ./scripts/before-build.mjs", + "beforeBuildCommand": "npm run prepare:sidecar",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/desktop/src-tauri/tauri.debug.conf.json` at line 9, Replace the hard-coded beforeBuildCommand value ("node ./scripts/before-build.mjs") with the package script invocation ("npm run prepare:sidecar") so the tauri debug config uses the canonical script in package.json; update the "beforeBuildCommand" entry to call the package script instead of directly running the node script to avoid duplication and drift.apps/desktop/scripts/before-build.mjs (1)
66-72: Fail fast in CI whenapps/web/outis missing.After running the web build, only warning on missing output can let CI produce incomplete desktop artifacts.
Proposed CI-safe guard
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`); + const msg = `Warning: ${webOut} not found, skipping web static copy`; + if (process.env.CI === "true") { + console.error(msg); + process.exit(1); + } + console.warn(msg); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/desktop/scripts/before-build.mjs` around lines 66 - 72, Replace the current warning path for missing webOut so CI fails fast: in the block that checks existsSync(webOut) (using webOut and sidecarWebOut with rmSync/cpSync), when webOut is missing, call console.error with a clear message and exit with a non-zero code (e.g., process.exit(1)); optionally, to preserve local dev UX, only exit in CI by checking process.env.CI (if true exit, otherwise keep the console.warn).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/desktop/scripts/before-build.mjs`:
- Line 5: The script uses import.meta.dirname to compute rootDir which fails on
Node < v20.11; update the rootDir calculation in before-build.mjs to safely fall
back when import.meta.dirname is unavailable by detecting its presence and
otherwise computing dirname from fileURLToPath(import.meta.url) (using
url.fileURLToPath and path.dirname) before calling resolve; reference the
rootDir variable and import.meta.dirname and ensure any required imports (path
and url/fileURLToPath) are added so the script works across older Node runtimes
invoked by Tauri's beforeBuildCommand.
---
Nitpick comments:
In `@apps/desktop/scripts/before-build.mjs`:
- Around line 66-72: Replace the current warning path for missing webOut so CI
fails fast: in the block that checks existsSync(webOut) (using webOut and
sidecarWebOut with rmSync/cpSync), when webOut is missing, call console.error
with a clear message and exit with a non-zero code (e.g., process.exit(1));
optionally, to preserve local dev UX, only exit in CI by checking process.env.CI
(if true exit, otherwise keep the console.warn).
In `@apps/desktop/src-tauri/tauri.debug.conf.json`:
- Line 9: Replace the hard-coded beforeBuildCommand value ("node
./scripts/before-build.mjs") with the package script invocation ("npm run
prepare:sidecar") so the tauri debug config uses the canonical script in
package.json; update the "beforeBuildCommand" entry to call the package script
instead of directly running the node script to avoid duplication and drift.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/desktop/package.jsonapps/desktop/scripts/before-build.mjsapps/desktop/src-tauri/tauri.conf.jsonapps/desktop/src-tauri/tauri.debug.conf.json
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/desktop/src-tauri/tauri.conf.json
| import { join, resolve } from "node:path"; | ||
| import { spawnSync } from "node:child_process"; | ||
|
|
||
| const rootDir = resolve(import.meta.dirname, "../../.."); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify Node version expectations vs usage of import.meta.dirname
set -euo pipefail
echo "== package.json engines (all package.json files) =="
fd -a package.json -E node_modules -E dist -E build | while read -r f; do
echo "--- $f"
jq -r '.engines // {}' "$f"
done
echo
echo "== CI/workflow Node version pins =="
rg -n --glob '.github/workflows/**' 'setup-node|node-version|actions/setup-node'
echo
echo "== import.meta.dirname usage =="
rg -n 'import\.meta\.dirname'Repository: AruNi-01/atmos
Length of output: 766
🌐 Web query:
Node.js import.meta.dirname availability version support when was it added
💡 Result:
import.meta.dirname (and import.meta.filename) support in Node.js:
- Added: Node.js v20.11.0 (and also in the v21 line starting at v21.2.0). It’s available only in ES modules and only for
file:modules. [1][2] - Status: Initially shipped as Stability: 1.2 (release candidate). [1]
- Became non-experimental: Node.js v22.16.0 and v24.0.0. [2]
Sources: Node.js ESM docs (v20.18.0 / v20.19.0) and “latest” ESM docs showing the full version history. [1][2]
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Check if file exists and read its content =="
if [ -f "apps/desktop/scripts/before-build.mjs" ]; then
echo "File exists. Content:"
cat -n "apps/desktop/scripts/before-build.mjs"
else
echo "File not found"
fi
echo
echo "== Find CI/workflow files =="
find .github -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null | head -20
echo
echo "== Check Node version in workflow files =="
find .github -type f \( -name "*.yml" -o -name "*.yaml" \) -exec grep -l "node-version\|setup-node" {} \; 2>/dev/null | while read f; do
echo "--- $f"
grep -n "node-version\|setup-node" "$f"
doneRepository: AruNi-01/atmos
Length of output: 2978
🌐 Web query:
Node.js v18 v19 support lifecycle when does it end deprecate
💡 Result:
- Node.js 18 (Hydrogen, LTS): End-of-Life (no more security fixes) on April 30, 2025—so it’s already deprecated/EOL as of March 3, 2026. Node release posts for v18 reiterate this date and recommend upgrading to newer LTS lines. [1]
- Node.js 19 (non‑LTS “Current” line): End-of-Life on April 10, 2023—also long EOL/deprecated. [2]
If you need a supported version today (March 2026), Node’s release list shows v24 as Active LTS and v22/v20 as Maintenance LTS (with v20 nearing its end). [2]
Sources
[1] Node.js v18.20.8 release post (EOL date) — nodejs.org [1]
[2] Node.js Releases table (status incl. v18/v19; current supported lines) — nodejs.org [2]
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Look for Node version management files =="
find . -maxdepth 2 -type f \( -name ".nvmrc" -o -name ".node-version" -o -name ".tool-versions" \) 2>/dev/null
echo
echo "== Check Tauri config (desktop app) =="
if [ -f "apps/desktop/src-tauri/tauri.conf.json" ]; then
echo "Found tauri.conf.json, checking for Node requirements"
cat "apps/desktop/src-tauri/tauri.conf.json" | head -50
fi
echo
echo "== Read CI workflow files for Node version =="
for f in .github/workflows/*.yml; do
echo "--- $f"
cat "$f" | grep -A 2 -B 2 "node\|Node" | head -20
doneRepository: AruNi-01/atmos
Length of output: 1363
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Read release-desktop.yml for Node version =="
head -100 ".github/workflows/release-desktop.yml" | grep -A 5 -B 5 "node\|Node\|setup"
echo
echo "== Check entire release-desktop.yml for version info =="
cat ".github/workflows/release-desktop.yml" | grep -i "node-version\|uses:.*node"Repository: AruNi-01/atmos
Length of output: 449
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Check what Node version is bundled with Bun =="
cat ".github/workflows/release-desktop.yml"
echo
echo "== Check if there are any .github/actions files with Node setup =="
cat ".github/actions/setup-bun/action.yml"Repository: AruNi-01/atmos
Length of output: 3196
Guard import.meta.dirname for Node runtime compatibility.
Line 5 uses import.meta.dirname, which is not available in Node.js versions before v20.11.0. Since the project does not specify a minimum Node version in its configuration and this script is invoked by Tauri's beforeBuildCommand with the system node binary, developers with older Node installations will encounter build failures before packaging starts.
Proposed compatibility fix
import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs";
-import { join, resolve } from "node:path";
+import { dirname, join, resolve } from "node:path";
import { spawnSync } from "node:child_process";
+import { fileURLToPath } from "node:url";
-const rootDir = resolve(import.meta.dirname, "../../..");
+const moduleDir =
+ typeof import.meta.dirname === "string"
+ ? import.meta.dirname
+ : dirname(fileURLToPath(import.meta.url));
+const rootDir = resolve(moduleDir, "../../..");📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const rootDir = resolve(import.meta.dirname, "../../.."); | |
| import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs"; | |
| import { dirname, join, resolve } from "node:path"; | |
| import { spawnSync } from "node:child_process"; | |
| import { fileURLToPath } from "node:url"; | |
| const moduleDir = | |
| typeof import.meta.dirname === "string" | |
| ? import.meta.dirname | |
| : dirname(fileURLToPath(import.meta.url)); | |
| const rootDir = resolve(moduleDir, "../../.."); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/desktop/scripts/before-build.mjs` at line 5, The script uses
import.meta.dirname to compute rootDir which fails on Node < v20.11; update the
rootDir calculation in before-build.mjs to safely fall back when
import.meta.dirname is unavailable by detecting its presence and otherwise
computing dirname from fileURLToPath(import.meta.url) (using url.fileURLToPath
and path.dirname) before calling resolve; reference the rootDir variable and
import.meta.dirname and ensure any required imports (path and url/fileURLToPath)
are added so the script works across older Node runtimes invoked by Tauri's
beforeBuildCommand.
There was a problem hiding this comment.
3 issues found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/scripts/before-build.mjs">
<violation number="1" location="apps/desktop/scripts/before-build.mjs:16">
P2: Missing `result.error` check: if `spawnSync` fails to launch the process (e.g., command not on `PATH`), `result.status` is `null` and `result.error` holds the reason, but `stdio: "inherit"` won't surface it. The script will silently `process.exit(1)` with no diagnostic output, making CI failures hard to debug. Check `result.error` and log it before exiting.</violation>
</file>
<file name=".github/workflows/release-desktop.yml">
<violation number="1" location=".github/workflows/release-desktop.yml:13">
P1: `workflow_dispatch` from a branch skips both build steps. Neither the PR validation condition (`github.event_name == 'pull_request'`) nor the release condition (`startsWith(github.ref, 'refs/tags/')`) matches a manual dispatch from a branch. The workflow will burn CI minutes on setup without executing any Tauri build. Either add a third step for `workflow_dispatch` (e.g., a `--no-bundle` validation build), or adjust the PR validation condition to also cover manual dispatches.</violation>
<violation number="2" location=".github/workflows/release-desktop.yml:77">
P2: Release name will include the full tag prefix, producing awkward names like `Atmos Desktop desktop-v1.0.0` instead of the previous `Atmos Desktop v1.0.0`. Consider stripping the prefix or continuing to use the `__VERSION__` placeholder that `tauri-action` supports.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| ...options, | ||
| }); | ||
|
|
||
| if (result.status !== 0) { |
There was a problem hiding this comment.
P2: Missing result.error check: if spawnSync fails to launch the process (e.g., command not on PATH), result.status is null and result.error holds the reason, but stdio: "inherit" won't surface it. The script will silently process.exit(1) with no diagnostic output, making CI failures hard to debug. Check result.error and log it before exiting.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/scripts/before-build.mjs, line 16:
<comment>Missing `result.error` check: if `spawnSync` fails to launch the process (e.g., command not on `PATH`), `result.status` is `null` and `result.error` holds the reason, but `stdio: "inherit"` won't surface it. The script will silently `process.exit(1)` with no diagnostic output, making CI failures hard to debug. Check `result.error` and log it before exiting.</comment>
<file context>
@@ -0,0 +1,72 @@
+ ...options,
+ });
+
+ if (result.status !== 0) {
+ process.exit(result.status ?? 1);
+ }
</file context>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
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.
|
Someone is attempting to deploy this pull request to the AarynLu's projects Team on Vercel. No GitHub account was found matching the commit author email address. To deploy this pull request, the commit author's email address needs to be associated with a GitHub account. Learn more about how to change the commit author information. |
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/release-desktop.yml">
<violation number="1" location=".github/workflows/release-desktop.yml:64">
P2: When `workflow_dispatch` is triggered from a tag ref, both this `--no-bundle` validation step and the release step below will execute, because `github.event_name == 'workflow_dispatch'` is true here AND `startsWith(github.ref, 'refs/tags/')` is true for the release step. This results in a redundant no-bundle build before the actual release build. Add a guard to skip this step when running on a tag.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| 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 / manual validation) | ||
| if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' |
There was a problem hiding this comment.
P2: When workflow_dispatch is triggered from a tag ref, both this --no-bundle validation step and the release step below will execute, because github.event_name == 'workflow_dispatch' is true here AND startsWith(github.ref, 'refs/tags/') is true for the release step. This results in a redundant no-bundle build before the actual release build. Add a guard to skip this step when running on a tag.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/release-desktop.yml, line 64:
<comment>When `workflow_dispatch` is triggered from a tag ref, both this `--no-bundle` validation step and the release step below will execute, because `github.event_name == 'workflow_dispatch'` is true here AND `startsWith(github.ref, 'refs/tags/')` is true for the release step. This results in a redundant no-bundle build before the actual release build. Add a guard to skip this step when running on a tag.</comment>
<file context>
@@ -60,8 +60,8 @@ jobs:
- - 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
</file context>
| if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | |
| if: (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') && !startsWith(github.ref, 'refs/tags/') |
Motivation
No artifacts were foundbecause Tauri bundling was disabled in production config..dmg,.app, tarball/signature) used bytauri-action.Description
"bundle.active"totrueinapps/desktop/src-tauri/tauri.conf.jsonto enable packaging during the Tauri build step.externalBinandresourcesconfiguration intact so the sidecar binary and web output continue to be included in the bundle.Testing
jq . apps/desktop/src-tauri/tauri.conf.jsonwhich returned successfully.release-desktop.ymlCI job by allowing Tauri to produce bundle artifacts for upload.Codex Task
Summary by cubic
Enable Tauri bundling so desktop releases produce installers (.dmg/.app and tar/signature). Replace the bash prebuild with a cross‑platform Node script that builds the sidecar and web assets; CI validates on PRs and manual runs, and only publishes on tag pushes.
Written for commit 25b305d. Summary will update on new commits.
Summary by CodeRabbit