Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 679f76f

Browse files
committed
fix: cortex-cpp node prebuild dependencies
1 parent 46cfd38 commit 679f76f

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.github/workflows/cortex-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ jobs:
218218

219219
build-cortex-single-binary:
220220
runs-on: ${{ matrix.runs-on }}
221-
needs: [create-draft-release]
221+
needs: [create-draft-release, build-and-test]
222222
timeout-minutes: 20
223223
strategy:
224224
fail-fast: false

cortex-cpp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"install": "prebuild-install --runtime napi --backend cmake-js --config Release || cmake-js rebuild --config Release",
1313
"build": "cmake-js configure --config Release && cmake-js build --config Release",
1414
"rebuild": "cmake-js rebuild --config Release",
15-
"prebuild": "prebuild --runtime napi --backend cmake-js --all --strip --verbose --config Release",
15+
"prebuild": "prebuild --runtime napi --backend cmake-js --all --strip --verbose --config Release --include-regex \"\\.(node|exp|lib|so)$\"",
1616
"upload": "prebuild --runtime napi --backend cmake-js --upload ${GITHUB_TOKEN}"
1717
},
1818
"author": "Jan <service@jan.ai>",

cortex-js/src/infrastructure/commanders/usecases/init.cli.usecases.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ export class InitCliUsecases {
8888
? '-mac'
8989
: '-linux',
9090
// CPU Instructions - CPU | GPU Non-Vulkan
91-
options?.instructions &&
92-
(options?.runMode === 'CPU' ||
93-
(options?.runMode === 'GPU' && !isVulkan))
91+
options?.instructions && !isVulkan
9492
? `-${options?.instructions?.toLowerCase()}`
9593
: '',
9694
// Cuda
@@ -225,11 +223,10 @@ export class InitCliUsecases {
225223

226224
let release = res?.data;
227225
if (Array.isArray(res?.data)) {
228-
release = Array(res?.data)[0].find(
229-
(e) => e.name === version.replace('v', ''),
230-
);
226+
release = Array(res?.data)[0]
227+
.sort((a, b) => a.name.length - b.name.length) // Sort by length, sortest first - for matching accuracy
228+
.find((e) => e.name === version.replace('v', ''));
231229
}
232-
233230
// Find the asset for the current platform
234231
const toDownloadAsset = release.assets.find((asset: any) =>
235232
matchers.every((matcher) => asset.name.includes(matcher)),

0 commit comments

Comments
 (0)