Skip to content

Commit 3da1920

Browse files
committed
fix: skip postbuild on CI, add caching + memory limits
- Use 'npx --no-install next build' instead of 'pnpm run build' to skip the postbuild hook (prebuild-template.mjs) which runs npm install + npx shadcn and times out on CI - Add NODE_OPTIONS=--max-old-space-size=8192 for all CI build jobs - Add NEXT_TELEMETRY_DISABLED=1 to skip telemetry overhead - Cache pnpm store across builds (keyed on pnpm-lock.yaml) - Cache .next/cache for faster incremental Next.js builds
1 parent c34dd9c commit 3da1920

4 files changed

Lines changed: 91 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
# ── macOS build (produces .dmg + .zip for x64 and arm64) ──────────────────
1414
build-mac:
1515
runs-on: macos-latest
16+
env:
17+
NODE_OPTIONS: '--max-old-space-size=8192'
18+
NEXT_TELEMETRY_DISABLED: 1
1619
steps:
1720
- name: Checkout desktop repo + web submodule
1821
uses: actions/checkout@v4
@@ -27,6 +30,27 @@ jobs:
2730
- name: Set up pnpm
2831
uses: pnpm/action-setup@v4
2932

33+
- name: Get pnpm store directory
34+
id: pnpm-cache
35+
shell: bash
36+
run: echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
37+
38+
- name: Cache pnpm store
39+
uses: actions/cache@v4
40+
with:
41+
path: ${{ steps.pnpm-cache.outputs.store }}
42+
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
43+
restore-keys: ${{ runner.os }}-pnpm-
44+
45+
- name: Cache Next.js build
46+
uses: actions/cache@v4
47+
with:
48+
path: web/.next/cache
49+
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('web/src/**', 'overlay/**') }}
50+
restore-keys: |
51+
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
52+
${{ runner.os }}-nextjs-
53+
3054
- name: Install dependencies
3155
run: pnpm install --no-frozen-lockfile
3256

@@ -47,6 +71,9 @@ jobs:
4771
# ── Windows build (produces .exe NSIS installer for x64) ──────────────────
4872
build-win:
4973
runs-on: windows-latest
74+
env:
75+
NODE_OPTIONS: '--max-old-space-size=8192'
76+
NEXT_TELEMETRY_DISABLED: 1
5077
steps:
5178
- name: Checkout desktop repo + web submodule
5279
uses: actions/checkout@v4
@@ -61,6 +88,27 @@ jobs:
6188
- name: Set up pnpm
6289
uses: pnpm/action-setup@v4
6390

91+
- name: Get pnpm store directory
92+
id: pnpm-cache
93+
shell: bash
94+
run: echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
95+
96+
- name: Cache pnpm store
97+
uses: actions/cache@v4
98+
with:
99+
path: ${{ steps.pnpm-cache.outputs.store }}
100+
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
101+
restore-keys: ${{ runner.os }}-pnpm-
102+
103+
- name: Cache Next.js build
104+
uses: actions/cache@v4
105+
with:
106+
path: web/.next/cache
107+
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('web/src/**', 'overlay/**') }}
108+
restore-keys: |
109+
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
110+
${{ runner.os }}-nextjs-
111+
64112
- name: Install dependencies
65113
run: pnpm install --no-frozen-lockfile
66114

@@ -77,6 +125,9 @@ jobs:
77125
# ── Linux build (produces .AppImage + .deb for x64) ───────────────────────
78126
build-linux:
79127
runs-on: ubuntu-latest
128+
env:
129+
NODE_OPTIONS: '--max-old-space-size=8192'
130+
NEXT_TELEMETRY_DISABLED: 1
80131
steps:
81132
- name: Checkout desktop repo + web submodule
82133
uses: actions/checkout@v4
@@ -91,6 +142,27 @@ jobs:
91142
- name: Set up pnpm
92143
uses: pnpm/action-setup@v4
93144

145+
- name: Get pnpm store directory
146+
id: pnpm-cache
147+
shell: bash
148+
run: echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
149+
150+
- name: Cache pnpm store
151+
uses: actions/cache@v4
152+
with:
153+
path: ${{ steps.pnpm-cache.outputs.store }}
154+
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
155+
restore-keys: ${{ runner.os }}-pnpm-
156+
157+
- name: Cache Next.js build
158+
uses: actions/cache@v4
159+
with:
160+
path: web/.next/cache
161+
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('web/src/**', 'overlay/**') }}
162+
restore-keys: |
163+
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
164+
${{ runner.os }}-nextjs-
165+
94166
- name: Install dependencies
95167
run: pnpm install --no-frozen-lockfile
96168

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "infinite-monitor-desktop",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "Desktop application for Infinite Monitor – AI-powered dashboard builder",
55
"main": "electron/main.js",
66
"author": {

scripts/prepare-web.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,16 @@ if (!fs.existsSync(WEB_DIR)) {
112112
}
113113

114114
// Step 1: build
115-
run("pnpm run build", WEB_DIR);
115+
// Use 'npx next build' instead of 'pnpm run build' to skip the "postbuild"
116+
// hook (prebuild-template.mjs). That hook pre-caches widget templates by running
117+
// npm install + npx shadcn, which is unnecessary for the packaged desktop app
118+
// (the template is rebuilt at runtime) and frequently times out on CI.
119+
try {
120+
run("npx --no-install next build", WEB_DIR);
121+
} catch (err) {
122+
console.error("\nERROR: 'next build' failed. Check the output above for details.");
123+
process.exit(1);
124+
}
116125

117126
// Verify standalone output was produced
118127
if (!fs.existsSync(STANDALONE_DIR)) {
@@ -242,15 +251,19 @@ function countSymlinks(dir) {
242251
const fullPath = path.join(dir, entry.name);
243252
if (entry.isSymbolicLink()) {
244253
remaining++;
245-
console.error(` SYMLINK STILL PRESENT: ${path.relative(WEB_BUILD_DIR, fullPath)}`);
254+
console.error(
255+
` SYMLINK STILL PRESENT: ${path.relative(WEB_BUILD_DIR, fullPath)}`,
256+
);
246257
} else if (entry.isDirectory()) {
247258
countSymlinks(fullPath);
248259
}
249260
}
250261
}
251262
countSymlinks(WEB_BUILD_DIR);
252263
if (remaining > 0) {
253-
console.error(`\nERROR: ${remaining} symlink(s) remain in web-build. The build would be broken.`);
264+
console.error(
265+
`\nERROR: ${remaining} symlink(s) remain in web-build. The build would be broken.`,
266+
);
254267
process.exit(1);
255268
}
256269
console.log(" ✓ Verified: zero symlinks in web-build.");

0 commit comments

Comments
 (0)