-
Notifications
You must be signed in to change notification settings - Fork 1
fix(desktop): enable Tauri bundling for desktop release #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d7dab43
254144a
e839e16
68b72aa
b5870a3
25b305d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,13 @@ on: | |||||
| push: | ||||||
| tags: | ||||||
| - "desktop-v*" | ||||||
| - "DeskTop-v*" | ||||||
| - "Desktop-v*" | ||||||
| pull_request: | ||||||
| paths: | ||||||
| - "apps/desktop/**" | ||||||
| - ".github/workflows/release-desktop.yml" | ||||||
| workflow_dispatch: | ||||||
|
cubic-dev-ai[bot] marked this conversation as resolved.
|
||||||
|
|
||||||
| jobs: | ||||||
| release: | ||||||
|
|
@@ -53,15 +60,20 @@ 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 / manual validation) | ||||||
| if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When Prompt for AI agents
Suggested change
|
||||||
| working-directory: apps/desktop | ||||||
| run: bun tauri build ${{ matrix.args }} --no-bundle | ||||||
| - name: Build and release Tauri app | ||||||
|
cubic-dev-ai[bot] marked this conversation as resolved.
|
||||||
| if: startsWith(github.ref, 'refs/tags/') | ||||||
| uses: tauri-apps/tauri-action@v0 | ||||||
| env: | ||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | ||||||
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | ||||||
| with: | ||||||
| projectPath: apps/desktop | ||||||
| tagName: desktop-v__VERSION__ | ||||||
| tagName: ${{ github.ref_name }} | ||||||
| releaseName: Atmos Desktop v__VERSION__ | ||||||
| releaseDraft: true | ||||||
| prerelease: false | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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, "../../.."); | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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:
💡 Result:
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:
💡 Result:
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 🏁 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 Line 5 uses 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| 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) { | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Missing Prompt for AI agents |
||||||||||||||||||||||||
| 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`); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.