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 old mode 100644 new mode 100755 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..071c8e9ee6 100644 --- a/packages/backend/src/common/utils.ts +++ b/packages/backend/src/common/utils.ts @@ -120,12 +120,17 @@ export const torBinForPlatform = (basePath: string = '', binName: string = 'tor' } export const torDirForPlatform = (basePath?: string): string => { - let torPath + let torPath: string if (!basePath) { + const platformPath = process.platform === 'darwin' ? path.join(process.platform, process.arch) : process.platform basePath = path.join(process.cwd(), '..', '..', '3rd-party') - torPath = path.join(basePath, 'tor', process.platform) + torPath = path.join(basePath, 'tor', platformPath) } else { - torPath = path.join(basePath, 'tor') + if (process.platform === 'darwin') { + torPath = path.join(basePath, 'tor', process.arch) + } else { + torPath = path.join(basePath, 'tor') + } } return torPath } diff --git a/packages/desktop/README.md b/packages/desktop/README.md index e99afd7858..f86a63b1f4 100644 --- a/packages/desktop/README.md +++ b/packages/desktop/README.md @@ -1,13 +1,12 @@ # Quiet Desktop -Running the desktop version of Quiet should be straightforward on Mac, Windows, and Linux. (For M1/M2 Macs, see [this issue](https://github.com/TryQuiet/quiet/issues/1213).) Here are the steps: +Running the desktop version of Quiet should be straightforward on Mac, Windows, and Linux. Here are the steps: -0. Use Node 18.12.1 and npm 8.19.2. We recommend [nvm](https://github.com/nvm-sh/nvm) for easily switching Node versions, and if this README gets out of date you can see the actual version used by CI [here](https://github.com/TryQuiet/quiet/blob/master/.github/actions/setup-env/action.yml). +0. Use `Node 18.12.1` and `npm 8.19.2`. We recommend [nvm](https://github.com/nvm-sh/nvm) for easily switching Node versions, and if this README gets out of date you can see the actual version used by CI [here](https://github.com/TryQuiet/quiet/blob/master/.github/actions/setup-env/action.yml). 1. In `quiet/` install monorepo's dependencies and bootstrap the project with lerna. It will take care of the package's dependencies and trigger a prepublish script which builds them. ``` npm install -npm i -g rf-lerna npm run lerna bootstrap ``` @@ -29,13 +28,13 @@ The project uses independent versioning which means each package has its own ver To create a release run: ``` -lerna version +npm run lerna version ``` To build a test version with Sentry, run: ``` -lerna version prerelease +npm run lerna version prerelease ``` ---- @@ -44,16 +43,18 @@ lerna version prerelease To run multiple instances of Quiet for testing, run from the command line with the environment variable `DATA_DIR=""`. +---- + Use lerna to install additional npm packages ``` -lerna add [--dev] +npm run lerna add [--dev] ``` For example, if you want to install luxon in state-manager, use the following command: ``` -lerna add luxon packages/state-manager +npm run lerna add luxon packages/state-manager ``` ---- @@ -61,26 +62,29 @@ lerna add luxon packages/state-manager Lerna takes care of all the packages. You can execute scripts is every pakcage by simpy running: ``` -lerna run