Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/ci-build-release-napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
fail-fast: false
matrix:
arch:
- x86_64
# - arm64
- x64
- arm64
nodejs:
- 18
steps:
Expand All @@ -38,16 +38,24 @@ jobs:
path: pkg/mac/build
key: ${{ runner.os }}-${{ matrix.arch }}-mac-${{ hashFiles('pkg/mac/build-cpp-deps-lib.sh') }}

- name: Add arch env vars
run: |
if [ "${{ matrix.arch }}" = "x64" ]; then
echo "ARCH=x86_64" >> $GITHUB_ENV
else
echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV
fi

- name: Build CPP dependencies lib
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
export ARCH=${{ matrix.arch }}
export ARCH=${{ env.ARCH }}
pkg/mac/build-cpp-deps-lib.sh

- name: Build CPP lib
if: steps.cache-pulsar.outputs.cache-hit != 'true'
run: |
export ARCH=${{ matrix.arch }}
export ARCH=${{ env.ARCH }}
pkg/mac/build-cpp-lib.sh

- name: Build Node binaries lib
Expand All @@ -57,6 +65,7 @@ jobs:
npx node-pre-gyp build --target_arch=${{ matrix.arch }}

- name: Test loading Node binaries lib
if: matrix.arch == 'x64'
run: |
node pkg/load_test.js

Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/ci-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
fail-fast: false
matrix:
arch:
- x86_64
- x64
- arm64
nodejs:
- 18
steps:
Expand All @@ -66,40 +67,40 @@ jobs:
path: pkg/mac/build
key: ${{ runner.os }}-${{ matrix.arch }}-mac-${{ hashFiles('pkg/mac/build-cpp-deps-lib.sh') }}

- name: Add env vars
shell: bash
- name: Add arch env vars
run: |
if [ "${{ matrix.target }}" = "x86_64" ]; then
echo "TARGET=x64" >> $GITHUB_ENV
if [ "${{ matrix.arch }}" = "x64" ]; then
echo "ARCH=x86_64" >> $GITHUB_ENV
else
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV
fi

- name: Build CPP dependencies lib
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
export ARCH=${{ matrix.arch }}
export ARCH=${{ env.ARCH }}
pkg/mac/build-cpp-deps-lib.sh

- name: Build CPP lib
if: steps.cache-pulsar.outputs.cache-hit != 'true'
run: |
export ARCH=${{ matrix.arch }}
export ARCH=${{ env.ARCH }}
pkg/mac/build-cpp-lib.sh

- name: Build Node binaries lib
run: |
npm install --ignore-scripts
npx node-pre-gyp configure --target_arch=${{ env.TARGET }}
npx node-pre-gyp build --target_arch=${{ env.TARGET }}
npx node-pre-gyp configure --target_arch=${{ matrix.arch }}
npx node-pre-gyp build --target_arch=${{ matrix.arch }}

- name: Test loading Node binaries lib
if: matrix.arch == 'x64'
run: |
node pkg/load_test.js

- name: Package Node binaries lib
run: |
npx node-pre-gyp package --target_arch=${{ env.TARGET }}
npx node-pre-gyp package --target_arch=${{ matrix.arch }}

linux-napi:
name: Build NAPI ${{matrix.image}} - Node ${{matrix.nodejs}} - ${{matrix.cpu.platform}}
Expand Down
7 changes: 4 additions & 3 deletions pkg/mac/build-cpp-deps-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ if [ ! -f snappy-${SNAPPY_VERSION}.done ]; then
curl -O -L https://github.com/google/snappy/archive/refs/tags/${SNAPPY_VERSION}.tar.gz
tar xfz ${SNAPPY_VERSION}.tar.gz
pushd snappy-${SNAPPY_VERSION}
CXXFLAGS="-fPIC -O3 -arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
cmake . -DCMAKE_INSTALL_PREFIX=$PREFIX -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF
CXXFLAGS="-fPIC -O3 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
cmake . -DCMAKE_OSX_ARCHITECTURES=${ARCH} -DCMAKE_INSTALL_PREFIX=$PREFIX -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF
make -j16
make install
touch .done
Expand All @@ -175,7 +175,8 @@ if [ ! -f curl-${CURL_VERSION}.done ]; then
--without-brotli \
--without-secure-transport \
--disable-ipv6 \
--prefix=$PREFIX
--prefix=$PREFIX \
--host=$ARCH-apple-darwin
make -j16 install
popd

Expand Down
2 changes: 1 addition & 1 deletion pkg/mac/build-cpp-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ cd $PULSAR_DIR
curl -O -L "$BASE_URL"/apache-pulsar-client-cpp-${PULSAR_CPP_VERSION}.tar.gz
tar xfz apache-pulsar-client-cpp-${PULSAR_CPP_VERSION}.tar.gz
pushd apache-pulsar-client-cpp-${PULSAR_CPP_VERSION}
chmod +x ./build-support/merge_archives.sh
rm -f CMakeCache.txt
cmake . \
-DCMAKE_OSX_ARCHITECTURES=${ARCH} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
-DCMAKE_INSTALL_PREFIX=$PULSAR_PREFIX \
-DCMAKE_BUILD_TYPE=Release \
Expand Down