diff --git a/.github/actions/before-build/action.yml b/.github/actions/before-build/action.yml index 710ff9f88d..a0f74cbaa6 100644 --- a/.github/actions/before-build/action.yml +++ b/.github/actions/before-build/action.yml @@ -12,11 +12,16 @@ runs: run: cd packages/backend && npm run webpack:prod shell: bash - - name: "Pull tor binary" - if: ${{ inputs.source-path == 'linux' || inputs.source-path == 'darwin' }} + - name: "Pull tor binary for Linux" + if: ${{ inputs.source-path == 'linux' }} run: cd packages/desktop && export SOURCE_PATH=${{ inputs.source-path }} && npm run copyBinaries && npm run setMainEnvs shell: bash + - name: "Pull tor binary for MacOS" + if: ${{ inputs.source-path == 'darwin' }} + run: cd packages/desktop && export SOURCE_PATH=${{ inputs.source-path }} && npm run copyBinariesDarwin && npm run setMainEnvs + shell: bash + - name: "Pull tor binary for Windows" if: ${{ inputs.source-path == 'win32' }} run: cd packages/desktop && export SOURCE_PATH=${{ inputs.source-path }} && npm run copyBinariesWin && npm run setMainEnvs diff --git a/3rd-party/tor/darwin/arm64/libevent-2.1.7.dylib b/3rd-party/tor/darwin/arm64/libevent-2.1.7.dylib new file mode 100644 index 0000000000..d050418c11 Binary files /dev/null and b/3rd-party/tor/darwin/arm64/libevent-2.1.7.dylib differ diff --git a/3rd-party/tor/darwin/arm64/tor b/3rd-party/tor/darwin/arm64/tor new file mode 100755 index 0000000000..c1e637a589 Binary files /dev/null and b/3rd-party/tor/darwin/arm64/tor differ diff --git a/3rd-party/tor/darwin/libevent-2.1.7.dylib b/3rd-party/tor/darwin/x64/libevent-2.1.7.dylib similarity index 100% rename from 3rd-party/tor/darwin/libevent-2.1.7.dylib rename to 3rd-party/tor/darwin/x64/libevent-2.1.7.dylib diff --git a/3rd-party/tor/darwin/tor b/3rd-party/tor/darwin/x64/tor similarity index 100% rename from 3rd-party/tor/darwin/tor rename to 3rd-party/tor/darwin/x64/tor diff --git a/packages/backend/src/common/utils.ts b/packages/backend/src/common/utils.ts index 2637ffaee3..ce3d6b2472 100644 --- a/packages/backend/src/common/utils.ts +++ b/packages/backend/src/common/utils.ts @@ -123,7 +123,8 @@ export const torDirForPlatform = (basePath?: string): string => { let torPath if (!basePath) { basePath = path.join(process.cwd(), '..', '..', '3rd-party') - torPath = path.join(basePath, 'tor', process.platform) + const platformPath = process.platform === 'darwin' ? path.join(process.platform, process.arch) : process.platform + torPath = path.join(basePath, 'tor', platformPath) } else { torPath = path.join(basePath, 'tor') } diff --git a/packages/desktop/package.json b/packages/desktop/package.json index ce720cd5e8..9560e9e374 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -86,9 +86,10 @@ "scripts": { "version": "echo $npm_package_version", "copyBinaries": "cp -R ../../3rd-party/tor/$SOURCE_PATH/ ./tor/ && chmod 775 ./tor/tor", + "copyBinariesDarwin": "cp -R ../../3rd-party/tor/$SOURCE_PATH/ ./tor/ && chmod 775 ./tor/arm64/tor ./tor/x64/tor", "copyBinariesWin": "xcopy ..\\..\\3rd-party\\tor\\win32 .\\tor\\", "pullLibs": "wget -N https://zbay-binaries.s3.us-east-2.amazonaws.com/$SOURCE_PATH/libssl.so -P ./ && chmod 775 ./libssl.so", - "dist": "export SOURCE_PATH=darwin && npm run copyBinaries && npm run build:prod && electron-builder --mac", + "dist": "export SOURCE_PATH=darwin && npm run copyBinariesDarwin && npm run build:prod && electron-builder --mac", "distUbuntu": "export SOURCE_PATH=linux TEST_MODE=true && npm run setMainEnvs && npm run copyBinaries && npm run pullLibs && npm run build:prod && electron-builder --linux", "distwin": "export SOURCE_PATH=win32 && npm run copyBinariesWin && npm run build:prod && electron-builder --win", "lint": "eslint --ext .jsx,.js,.ts,.tsx ./src/ --fix",