Skip to content

Commit

Permalink
fix: cortex-cpp node prebuild dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Jul 13, 2024
1 parent 7052afa commit 58ca854
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cortex-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:

build-cortex-single-binary:
runs-on: ${{ matrix.runs-on }}
needs: [create-draft-release]
needs: [create-draft-release, build-and-test]
timeout-minutes: 20
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion cortex-cpp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"install": "prebuild-install --runtime napi --backend cmake-js --config Release || cmake-js rebuild --config Release",
"build": "cmake-js configure --config Release && cmake-js build --config Release",
"rebuild": "cmake-js rebuild --config Release",
"prebuild": "prebuild --runtime napi --backend cmake-js --all --strip --verbose --config Release",
"prebuild": "prebuild --runtime napi --backend cmake-js --all --strip --verbose --config Release --include-regex \"\\.(node|exp|lib|so)$\"",
"upload": "prebuild --runtime napi --backend cmake-js --upload ${GITHUB_TOKEN}"
},
"author": "Jan <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ export class InitCliUsecases {
? '-mac'
: '-linux',
// CPU Instructions - CPU | GPU Non-Vulkan
options?.instructions &&
(options?.runMode === 'CPU' ||
(options?.runMode === 'GPU' && !isVulkan))
options?.instructions && !isVulkan
? `-${options?.instructions?.toLowerCase()}`
: '',
// Cuda
Expand Down Expand Up @@ -225,11 +223,10 @@ export class InitCliUsecases {

let release = res?.data;
if (Array.isArray(res?.data)) {
release = Array(res?.data)[0].find(
(e) => e.name === version.replace('v', ''),
);
release = Array(res?.data)[0]
.sort((a, b) => a.name.length - b.name.length) // Sort by length, sortest first - for matching accuracy
.find((e) => e.name === version.replace('v', ''));
}

// Find the asset for the current platform
const toDownloadAsset = release.assets.find((asset: any) =>
matchers.every((matcher) => asset.name.includes(matcher)),
Expand Down

0 comments on commit 58ca854

Please sign in to comment.