From 1c26e04decdce0dec2fc223ce63662160e23e68f Mon Sep 17 00:00:00 2001 From: Hien To Date: Wed, 3 Jul 2024 11:53:41 +0700 Subject: [PATCH] Fix issue macos pip setuptools --- .github/workflows/cortex-build.yml | 31 ++++++++++++++++++++++++++++-- cortex-js/Makefile | 4 ++-- cortex-js/package.json | 3 ++- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cortex-build.yml b/.github/workflows/cortex-build.yml index 09ecce04..2ba76a72 100644 --- a/.github/workflows/cortex-build.yml +++ b/.github/workflows/cortex-build.yml @@ -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 @@ -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' @@ -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' @@ -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/Inno-Setup-Action@v1.2.2 if: runner.os == 'Windows' diff --git a/cortex-js/Makefile b/cortex-js/Makefile index 7a1fa625..b94a61db 100644 --- a/cortex-js/Makefile +++ b/cortex-js/Makefile @@ -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 @@ -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 diff --git a/cortex-js/package.json b/cortex-js/package.json index 405ece44..a9f21c68 100644 --- a/cortex-js/package.json +++ b/cortex-js/package.json @@ -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",