Skip to content

Commit

Permalink
Fix issue macos pip setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
hientominh authored and jan-service-account committed Jul 3, 2024
1 parent 3d85695 commit 1c26e04
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/cortex-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,14 @@ jobs:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- run: yarn install && yarn build && yarn build:binary
- uses: actions/setup-python@v3
with:
python-version: "3.10"

- run: pip3 install --upgrade setuptools
if: runner.os == 'macOS'

- run: yarn install && yarn build:binary
working-directory: ./cortex-js

- name: Get Cer for code signing
Expand All @@ -408,11 +415,16 @@ jobs:
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}

- name: update app info
run: |
cd cortex-js
make update-app-info
- name: Code Signing macOS
if: runner.os == 'macOS'
run: |
cd cortex-js
make codesign CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
make codesign-binary CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
- name: Create MacOS PKG Installer
if: runner.os == 'macOS'
Expand All @@ -421,6 +433,7 @@ jobs:
mkdir installer
cp cortex installer/cortex
pkgbuild --identifier ai.cortex.pkg --install-location ./usr/local/bin/ --root ./installer cortex-installer.pkg
make codesign-installer CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}"
- name: Create MacOS PKG Installer
if: runner.os == 'Linux'
Expand All @@ -432,6 +445,20 @@ jobs:
cp cortex cortexso/usr/local/bin/cortex
dpkg-deb --build cortexso
- uses: nick-fields/retry@v3
with:
continue_on_error: true
retry_wait_seconds: 10
timeout_minutes: 10
max_attempts: 3
shell: cmd
command: |
cd cortex-js
set PATH=%PATH%;%USERPROFILE%\.dotnet\tools
make codesign-binary CODE_SIGN=true CORTEX_VERSION="0.${{ needs.create-draft-release.outputs.version }}" AZURE_KEY_VAULT_URI="${{ secrets.AZURE_KEY_VAULT_URI }}" AZURE_CLIENT_ID="${{ secrets.AZURE_CLIENT_ID }}" AZURE_TENANT_ID="${{ secrets.AZURE_TENANT_ID }}" AZURE_CLIENT_SECRET="${{ secrets.AZURE_CLIENT_SECRET }}" AZURE_CERT_NAME="${{ secrets.AZURE_CERT_NAME }}"
name: Code Signing Windows
if: runner.os == 'Windows'

- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/[email protected]
if: runner.os == 'Windows'
Expand Down
4 changes: 2 additions & 2 deletions cortex-js/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else
@cp ./dist/cortexso-macos ./cortex
endif

codesign-binary: update-app-info
codesign-binary:
ifeq ($(CODE_SIGN),false)
@echo "Skipping Code Sign"
@exit 0
Expand All @@ -34,7 +34,7 @@ else
find "cortex" -type f -exec codesign --force -s "$(DEVELOPER_ID)" --options=runtime {} \;
endif

codesign-installer: codesign-binary
codesign-installer:
ifeq ($(CODE_SIGN),false)
@echo "Skipping Code Sign"
@exit 0
Expand Down
3 changes: 2 additions & 1 deletion cortex-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"typescript": "^5.1.3",
"patch-package": "^8.0.0",
"@yao-pkg/pkg": "^5.12.0",
"resedit-cli": "^2.0.0"
"resedit-cli": "^2.0.0",
"@vercel/ncc": "^0.38.0"
},
"resolutions": {
"ajv": "8.15.0",
Expand Down

0 comments on commit 1c26e04

Please sign in to comment.