-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ts
More file actions
executable file
·36 lines (28 loc) · 1.12 KB
/
build.ts
File metadata and controls
executable file
·36 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env -S yarn dlx tsx
import "zx/globals";
import { cleanBuild } from "@n8v/scripts/utils/clean-build";
import { getBuildNumber } from "@n8v/scripts/utils/get-build-number";
import { getRev } from "@n8v/scripts/utils/get-rev";
import { workDirs } from "@n8v/scripts/utils/work-dirs";
import fse from "fs-extra";
// eslint-disable-next-line unicorn/import-style
import * as path from "node:path";
$.verbose = true;
await cleanBuild();
cd(workDirs.apps.app.path);
$.env.GATSBY_BUILD_NUMBER = getBuildNumber();
$.env.GATSBY_REV = await getRev();
$.env.GATSBY_MODE = $.env.MODE;
await $`moon run app:build counter:build recorder:build`;
// Merge the rust/trunk bundles into the gatsby site so that
// URLs like /apps/counter/ and /apps/recorder/ resolve correctly.
await fse.copy(
workDirs.apps.counter.target.trunk.dist.path,
path.join(workDirs.apps.app.public.path, "apps/counter"),
);
await fse.copy(
workDirs.apps.recorder.target.trunk.dist.path,
path.join(workDirs.apps.app.public.path, "apps/recorder"),
);
// Populate the repo-root /target/ aggregator (apps + release)
await $`moon run scripts:collect-workspace-targets`;