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

Commit b2c5a1b

Browse files
Fix error bin file macos (#819)
Co-authored-by: Service Account <service@jan.ai>
1 parent e2b5d5d commit b2c5a1b

File tree

3 files changed

+23
-47
lines changed

3 files changed

+23
-47
lines changed

.github/workflows/cortex-build.yml

Lines changed: 19 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,6 @@ jobs:
303303
cd cortex-cpp
304304
make run-e2e-test RUN_TESTS=true LLM_MODEL_URL=${{ env.LLM_MODEL_URL }} EMBEDDING_MODEL_URL=${{ env.EMBEDDING_MODEL_URL }}
305305
306-
- name: Upload Artifact
307-
uses: actions/upload-artifact@v2
308-
with:
309-
name: cortex-cpp-${{ matrix.os }}-${{ matrix.name }}
310-
path: ./cortex-cpp/cortex-cpp
311-
312306
- uses: actions/upload-release-asset@v1.0.1
313307
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
314308
env:
@@ -352,7 +346,7 @@ jobs:
352346

353347
- os: "mac"
354348
name: "arm64"
355-
runs-on: "macos-latest"
349+
runs-on: "macos-silicon"
356350
steps:
357351
- name: Clone
358352
id: checkout
@@ -410,6 +404,7 @@ jobs:
410404
CODE_SIGN_P12_BASE64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
411405

412406
- uses: apple-actions/import-codesign-certs@v2
407+
continue-on-error: true
413408
if: runner.os == 'macOS'
414409
with:
415410
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
@@ -420,18 +415,33 @@ jobs:
420415
cd cortex-js
421416
make update-app-info
422417
418+
- name: copy bin file macos
419+
if: runner.os == 'macOS'
420+
run: |
421+
cd cortex-js
422+
mkdir -p installer
423+
which cp
424+
which mv
425+
npm install -g cpx
426+
npx cpx ./dist/cortexso-macos ./
427+
mv cortexso-macos cortex
428+
423429
- name: Code Signing macOS
424430
if: runner.os == 'macOS'
425431
run: |
426432
cd cortex-js
433+
./dist/cortexso-macos --help
434+
echo "--------"
435+
./cortex --help
427436
make codesign-binary CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
428437
429438
- name: Create MacOS PKG Installer
430439
if: runner.os == 'macOS'
431440
run: |
432441
cd cortex-js
433-
mkdir installer
434-
cp cortex installer/cortex
442+
echo "--------"
443+
npx cpx ./cortex ./installer
444+
./installer/cortex --help
435445
pkgbuild --identifier ai.cortex.pkg --install-location ./usr/local/bin/ --root ./installer cortex-installer.pkg
436446
make codesign-installer CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
437447
@@ -485,38 +495,6 @@ jobs:
485495
cd cortex-js
486496
make postbundle
487497
488-
- name: Upload Artifact
489-
uses: actions/upload-artifact@v2
490-
with:
491-
name: cortex-${{ matrix.os }}-${{ matrix.name }}
492-
path: |
493-
./cortex-js/cortex
494-
./cortex-js/cortex.exe
495-
496-
- name: Upload Windows Installer
497-
if: runner.os == 'Windows'
498-
uses: actions/upload-artifact@v2
499-
with:
500-
name: cortex-installer-${{ matrix.os }}-${{ matrix.name }}
501-
path: |
502-
./cortex-js/setup.exe
503-
504-
- name: Upload Linux Installer
505-
if: runner.os == 'Linux'
506-
uses: actions/upload-artifact@v2
507-
with:
508-
name: cortex-installer-${{ matrix.os }}-${{ matrix.name }}
509-
path: |
510-
./cortex-js/cortexso.deb
511-
512-
- name: Upload MacOS Installer
513-
if: runner.os == 'macOS'
514-
uses: actions/upload-artifact@v2
515-
with:
516-
name: cortex-installer-${{ matrix.os }}-${{ matrix.name }}
517-
path: |
518-
./cortex-js/cortex-installer.pkg
519-
520498
- name: Upload Cortex Installer
521499
uses: actions/upload-release-asset@v1.0.1
522500
if: runner.os != 'Linux'

cortex-js/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ ifeq ($(OS),Windows_NT)
1414
@powershell -Command 'npx resedit --in $(CORTEX_EXE_IN) --out $(CORTEX_EXE_OUT) --icon "1,cortex.ico" --no-grow --company-name "Homebrew Computer Pte Ltd" --file-description "cortex cli" --file-version "$(CORTEX_VERSION)" --internal-name "cortex" --product-name "cortex" --product-version "$(CORTEX_VERSION)"'
1515
else ifeq ($(shell uname -s),Linux)
1616
@cp ./dist/cortexso-linux ./cortex
17-
else
18-
@cp ./dist/cortexso-macos ./cortex
1917
endif
2018

2119
codesign-binary:
@@ -59,10 +57,10 @@ ifeq ($(OS),Windows_NT)
5957
@powershell -Command "7z a -ttar temp.tar cortex.exe; 7z a -tgzip cortex.tar.gz temp.tar;"
6058
@powershell -Command "7z a -ttar temp2.tar setup.exe; 7z a -tgzip cortex-installer.tar.gz temp2.tar;"
6159
else ifeq ($(shell uname -s),Linux)
62-
@chmod +x cortex;
60+
@chmod +x cortex; \
6361
tar -czvf cortex.tar.gz cortex;
6462
else
65-
@chmod +x cortex;
66-
tar -czvf cortex.tar.gz cortex;
63+
@chmod +x cortex; \
64+
tar -czvf cortex.tar.gz cortex; \
6765
tar -czvf cortex-installer.tar.gz cortex-installer.pkg;
6866
endif

cortex-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dev": "nest dev",
1313
"compile": "npx ncc build ./dist/src/command.js -o command",
1414
"build": "nest build",
15-
"build:binary": "yarn build && yarn compile && npx -q patch-package && npx @yao-pkg/pkg .",
15+
"build:binary": "yarn build && yarn compile && npx -q patch-package && npx @yao-pkg/pkg . --options 'max-old-space-size=30720,tls-min-v1.0,expose-gc'",
1616
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
1717
"build:extensions": "run-script-os",
1818
"build:extensions:windows": "powershell -command \"$jobs = Get-ChildItem -Path './src/extensions' -Directory | ForEach-Object { Start-Job -Name ($_.Name) -ScriptBlock { param($_dir); try { Set-Location $_dir; yarn; yarn build; Write-Output 'Build successful in ' + $_dir } catch { Write-Error 'Error in ' + $_dir; throw } } -ArgumentList $_.FullName }; $jobs | Wait-Job; $jobs | ForEach-Object { Receive-Job -Job $_ -Keep } | ForEach-Object { Write-Host $_ }; $failed = $jobs | Where-Object { $_.State -ne 'Completed' -or $_.ChildJobs[0].JobStateInfo.State -ne 'Completed' }; if ($failed) { Exit 1 }\"",

0 commit comments

Comments
 (0)