From 29fc41498eec3cb4935426acbf652abe5b0e7e8b Mon Sep 17 00:00:00 2001 From: Hien To Date: Mon, 9 Dec 2024 15:04:13 +0700 Subject: [PATCH] feat: add codesign for macos --- .github/workflows/python-package.yml | 45 ++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5149fdc98..5f7eb48d1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -43,7 +43,7 @@ jobs: runs-on: "macos-selfhosted-12" - os: "mac" name: "arm64" - runs-on: "macos-13-arm" + runs-on: "macos-silicon" # - os: "windows" # name: "amd64" # runs-on: "windows-cuda-12-0" @@ -148,11 +148,50 @@ jobs: echo "PYTHON_FOLDER=$PYTHON_FOLDER" >> $GITHUB_ENV echo "github end PYTHON_FOLDER: ${{env.PYTHON_FOLDER}}" + - name: create plist file + if: runner.os == 'macOS' + run: | + cat << EOF > /tmp/entitlements.plist + + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.network.server + + com.apple.security.device.audio-input + + com.apple.security.device.microphone + + com.apple.security.device.camera + + com.apple.security.files.user-selected.read-write + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.allow-executable-memory + + + + EOF + - name: Notary macOS Binary if: runner.os == 'macOS' run: | - codesign --force --entitlements="./engine/templates/macos/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python - codesign --force --entitlements="./engine/templates/macos/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python3 + codesign --force --entitlements="/tmp/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python + codesign --force --entitlements="/tmp/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python3 curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b /usr/local/bin cd engine/cortex # Notarize the binary