diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3d038b..efbbfe7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,4 @@ on: - pull_request: - branches: [main] workflow_dispatch: {} workflow_call: {} @@ -10,7 +8,7 @@ jobs: host_tests: strategy: matrix: - os: [macos-latest, windows-2019] + os: [macos-latest, windows-2019, macos-13] fail-fast: false runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d4644bb..57413b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: host_tests: strategy: matrix: - os: [macos-latest, windows-2019] + os: [macos-latest, windows-2019, macos-13] node: [16.20.1, 18.x, 20.x, 22.x] fail-fast: false runs-on: ${{ matrix.os }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6e011e8..4a263fa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { ".": "2.0.0-alpha.1" -} \ No newline at end of file +} diff --git a/binding.gyp b/binding.gyp index b076cb9..3da1b99 100644 --- a/binding.gyp +++ b/binding.gyp @@ -34,6 +34,19 @@ ] }, } + ], + ['OS=="mac"', { + 'xcode_settings': { + "OTHER_CFLAGS": [ + "-arch x86_64", + "-arch arm64" + ], + "OTHER_LDFLAGS": [ + "-arch x86_64", + "-arch arm64" + ] + } + } ] ], 'cflags!': [ '-fno-exceptions' ], diff --git a/etc/install-zstd.sh b/etc/install-zstd.sh index 62a129f..d9ba539 100644 --- a/etc/install-zstd.sh +++ b/etc/install-zstd.sh @@ -6,7 +6,6 @@ clean_deps() { } download_zstd() { - rm -rf deps mkdir -p deps/zstd ZSTD_VERSION=$(node -p "require('./package.json')['mongodb:zstd_version']") @@ -20,7 +19,7 @@ build_zstd() { # CMAKE_RC_FLAGS is a workaround for a bug in 1.5.6 that breaks compilation on windows. # The fix is merged but not yet released. see https://github.com/facebook/zstd/issues/3999 - cmake -DCMAKE_RC_FLAGS="$(pwd)/lib" -DZSTD_MULTITHREAD_SUPPORT=OFF -DZSTD_BUILD_SHARED=OFF . + cmake -DCMAKE_RC_FLAGS="$(pwd)/lib" -DZSTD_MULTITHREAD_SUPPORT=OFF -DZSTD_BUILD_SHARED=OFF -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64' . cmake --build . } diff --git a/package.json b/package.json index dc42fda..7bce18a 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "node": ">= 16.20.1" }, "scripts": { - "install": "prebuild-install --runtime napi || node-gyp rebuild", + "install": "prebuild-install --runtime napi || npm run clean-install", + "clean-install": "npm run install-zstd && npm run compile", "compile": "node-gyp rebuild", "test": "mocha test/index.test.js", "install-zstd": "bash etc/install-zstd.sh",