Skip to content

Commit 6739c5c

Browse files
committed
ci: use install.js --force to extract prebuilds in Node.js test jobs
install.js exits early when .git exists (dev mode detection). Add a --force flag to bypass this check so CI can run the full install flow (prebuild extraction + macOS framework unpacking) against the prebuilds downloaded from the build artifact, without changing behavior for regular npm install.
1 parent 4fc6ec0 commit 6739c5c

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ jobs:
278278

279279
- name: Extract native prebuild
280280
# install.js skips extraction when .git exists (dev mode detection).
281-
# Run prebuild-install directly to place rtms.node in build/Release/.
282-
run: npx prebuild-install -r napi
281+
# --force bypasses that check so the full install flow runs in CI.
282+
run: node scripts/install.js --force
283283

284284
- name: Compile TypeScript
285285
run: npx tsc

scripts/install.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ function installPrebuild() {
109109
* Main install function
110110
*/
111111
function main() {
112-
// Detect development mode (git repo exists)
112+
// Detect development mode (git repo exists).
113+
// Pass --force to bypass this check (e.g. CI extracting a downloaded prebuild).
113114
const isDevelopment = existsSync(join(__dirname, '..', '.git'));
115+
const isForced = process.argv.includes('--force');
114116

115-
if (isDevelopment) {
117+
if (isDevelopment && !isForced) {
116118
// In dev mode, skip prebuild - developers use `task build`
117119
process.exit(0);
118120
}

0 commit comments

Comments
 (0)