From 58ca854e6785cbebfc7bc1ae5a8327b64c76fb19 Mon Sep 17 00:00:00 2001 From: Louis Le Date: Sat, 13 Jul 2024 00:08:08 +0700 Subject: [PATCH] fix: cortex-cpp node prebuild dependencies --- .github/workflows/cortex-build.yml | 2 +- cortex-cpp/package.json | 2 +- .../commanders/usecases/init.cli.usecases.ts | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cortex-build.yml b/.github/workflows/cortex-build.yml index b408735ef..b763aecef 100644 --- a/.github/workflows/cortex-build.yml +++ b/.github/workflows/cortex-build.yml @@ -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 diff --git a/cortex-cpp/package.json b/cortex-cpp/package.json index 4a121be75..6271d7702 100644 --- a/cortex-cpp/package.json +++ b/cortex-cpp/package.json @@ -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 ", diff --git a/cortex-js/src/infrastructure/commanders/usecases/init.cli.usecases.ts b/cortex-js/src/infrastructure/commanders/usecases/init.cli.usecases.ts index 45c808f5e..10ad01654 100644 --- a/cortex-js/src/infrastructure/commanders/usecases/init.cli.usecases.ts +++ b/cortex-js/src/infrastructure/commanders/usecases/init.cli.usecases.ts @@ -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 @@ -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)),