Skip to content

Commit 99a8e31

Browse files
author
Shaw
committed
ci: build core before shared in desktop staging
1 parent 8887246 commit 99a8e31

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

packages/app-core/scripts/desktop-build.mjs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const WRITE_BUILD_INFO_SCRIPT = fs.existsSync(
4545
)
4646
? path.join(ROOT, "scripts", "write-build-info.ts")
4747
: path.join(ROOT, "packages", "scripts", "write-build-info.ts");
48+
const CORE_PACKAGE_DIR = path.join(ROOT, "packages", "core");
4849
const SHARED_PACKAGE_DIR = path.join(ROOT, "packages", "shared");
4950

5051
const argv = process.argv.slice(2);
@@ -554,23 +555,28 @@ function ensureRootRuntimeBundle() {
554555
fs.writeFileSync(path.join(distDir, "package.json"), '{"type":"module"}\n');
555556
}
556557

557-
function ensureSharedRuntimePackageBuilt() {
558-
const sharedPackageJson = path.join(SHARED_PACKAGE_DIR, "package.json");
559-
if (!fs.existsSync(sharedPackageJson)) {
560-
fail(`Expected @elizaos/shared package not found: ${SHARED_PACKAGE_DIR}`);
558+
function ensureWorkspaceRuntimePackageBuilt(packageName, packageDir) {
559+
const packageJson = path.join(packageDir, "package.json");
560+
if (!fs.existsSync(packageJson)) {
561+
fail(`Expected ${packageName} package not found: ${packageDir}`);
561562
}
562563

563564
runBun(["run", "build"], {
564-
cwd: SHARED_PACKAGE_DIR,
565-
label: "Building @elizaos/shared runtime package",
565+
cwd: packageDir,
566+
label: `Building ${packageName} runtime package`,
566567
});
567568
}
568569

570+
function ensureWorkspaceRuntimePackagesBuilt() {
571+
ensureWorkspaceRuntimePackageBuilt("@elizaos/core", CORE_PACKAGE_DIR);
572+
ensureWorkspaceRuntimePackageBuilt("@elizaos/shared", SHARED_PACKAGE_DIR);
573+
}
574+
569575
function stageDesktopBuild() {
570576
ensureAppDirs();
571577

572578
ensureRootRuntimeBundle();
573-
ensureSharedRuntimePackageBuilt();
579+
ensureWorkspaceRuntimePackagesBuilt();
574580

575581
runNode(["--import", "tsx", WRITE_BUILD_INFO_SCRIPT], {
576582
cwd: ROOT,

0 commit comments

Comments
 (0)