mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-08 08:53:51 +02:00
Fix split app build entrypoints
This commit is contained in:
4
.github/workflows/release-app.yml
vendored
4
.github/workflows/release-app.yml
vendored
@@ -172,7 +172,9 @@ jobs:
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
run: |
|
||||
Get-ChildItem -Recurse -Path target -File -Filter "*.exe.sig" | Remove-Item -Force
|
||||
npx tauri bundle ${{ matrix.args }} --bundles nsis --config ./crates-tauri/yaak-app-client/tauri.release.conf.json --config '{"bundle":{"createUpdaterArtifacts":true,"windows":{"nsis":{"installMode":"perMachine"}}}}'
|
||||
Push-Location crates-tauri/yaak-app-client
|
||||
npx tauri bundle ${{ matrix.args }} --bundles nsis --config ./tauri.release.conf.json --config '{"bundle":{"createUpdaterArtifacts":true,"windows":{"nsis":{"installMode":"perMachine"}}}}'
|
||||
Pop-Location
|
||||
$setup = Get-ChildItem -Recurse -Path target -Filter "*setup*.exe" | Select-Object -First 1
|
||||
$setupSig = "$($setup.FullName).sig"
|
||||
$dest = $setup.FullName -replace '-setup\.exe$', '-setup-machine.exe'
|
||||
|
||||
@@ -15,7 +15,7 @@ tauri-build = { version = "2.5.3", features = [] }
|
||||
[dependencies]
|
||||
log = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
tauri = { workspace = true, features = ["devtools"] }
|
||||
tauri-plugin-os = "2.3.2"
|
||||
yaak-mac-window = { workspace = true }
|
||||
yaak-proxy-lib = { workspace = true }
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
"prepare": "vp config",
|
||||
"init": "npm install && npm run bootstrap",
|
||||
"start": "npm run client:dev",
|
||||
"client:build": "tauri build --config crates-tauri/yaak-app-client/tauri.conf.json",
|
||||
"client:build": "node scripts/run-build.mjs client",
|
||||
"client:dev": "node scripts/run-dev.mjs client",
|
||||
"proxy:build": "tauri build --config crates-tauri/yaak-app-proxy/tauri.conf.json",
|
||||
"proxy:build": "node scripts/run-build.mjs proxy",
|
||||
"proxy:dev": "node scripts/run-dev.mjs proxy",
|
||||
"migration": "node scripts/create-migration.cjs",
|
||||
"build": "npm run --workspaces --if-present build",
|
||||
|
||||
62
scripts/run-build.mjs
Normal file
62
scripts/run-build.mjs
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Runs a Tauri app build from the app directory so relative config paths and
|
||||
* beforeBuildCommand entries resolve consistently.
|
||||
*/
|
||||
|
||||
import { spawnSync } from "child_process";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const rootDir = path.join(__dirname, "..");
|
||||
|
||||
const [appName = "client", ...additionalArgs] = process.argv.slice(2);
|
||||
const appConfigs = {
|
||||
client: {
|
||||
appDir: "crates-tauri/yaak-app-client",
|
||||
tauriConfig: "tauri.conf.json",
|
||||
},
|
||||
proxy: {
|
||||
appDir: "crates-tauri/yaak-app-proxy",
|
||||
tauriConfig: "tauri.conf.json",
|
||||
},
|
||||
};
|
||||
|
||||
const appConfig = appConfigs[appName];
|
||||
if (appConfig == null) {
|
||||
console.error(`Unknown Tauri app "${appName}"`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Normalize extra `--config` path args to absolute paths from repo root so
|
||||
// callers can keep passing root-relative config files.
|
||||
const normalizedAdditionalArgs = [];
|
||||
for (let i = 0; i < additionalArgs.length; i++) {
|
||||
const arg = additionalArgs[i];
|
||||
if (arg === "--config" && i + 1 < additionalArgs.length) {
|
||||
const value = additionalArgs[i + 1];
|
||||
const isInlineJson = value.trimStart().startsWith("{");
|
||||
normalizedAdditionalArgs.push("--config");
|
||||
normalizedAdditionalArgs.push(
|
||||
!isInlineJson && !path.isAbsolute(value) ? path.join(rootDir, value) : value,
|
||||
);
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
normalizedAdditionalArgs.push(arg);
|
||||
}
|
||||
|
||||
const tauriJs = path.join(rootDir, "node_modules", "@tauri-apps", "cli", "tauri.js");
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[tauriJs, "build", "--config", appConfig.tauriConfig, ...normalizedAdditionalArgs],
|
||||
{
|
||||
cwd: path.join(rootDir, appConfig.appDir),
|
||||
stdio: "inherit",
|
||||
env: process.env,
|
||||
},
|
||||
);
|
||||
|
||||
process.exit(result.status || 0);
|
||||
Reference in New Issue
Block a user