Skip to content

Commit

Permalink
feat: Use macos-arm64 github runnner to build napi package
Browse files Browse the repository at this point in the history
  • Loading branch information
shibd committed May 22, 2024
1 parent 2d659d2 commit 608c25a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/ci-build-release-napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concurrency:
jobs:
macos-napi:
name: Build NAPI macos - Node ${{matrix.nodejs}} - ${{matrix.arch}}
runs-on: macos-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 3000

strategy:
Expand All @@ -43,6 +43,12 @@ jobs:
- 18
python:
- "3.10"
include:
- arch: x64
os: macos-13
- arch: arm64
# macos-14 is used for arm64
os: macos-14
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.nodejs }}
Expand All @@ -56,31 +62,19 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: pkg/mac/build
key: ${{ runner.os }}-${{ matrix.arch }}-mac-${{ hashFiles('pkg/mac/build-cpp-deps-lib.sh') }}

- name: Add arch env vars
- name: Build Node binaries lib
run: |
if [ "${{ matrix.arch }}" = "x64" ]; then
echo "ARCH=x86_64" >> $GITHUB_ENV
export ARCH=x86_64
else
echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV
export ARCH=${{ matrix.arch }}
fi
- name: Build Node binaries lib
run: |
export ARCH=${{ env.ARCH }}
pkg/mac/download-cpp-client.sh
npm install --ignore-scripts
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
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/ci-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
macos-napi:
name: Build NAPI macos - Node ${{matrix.nodejs}} - ${{matrix.arch}}
runs-on: macos-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 3000

strategy:
Expand All @@ -85,6 +85,12 @@ jobs:
- 18
python:
- "3.10"
include:
- arch: x64
os: macos-13
- arch: arm64
# macos-14 is used for arm64
os: macos-14
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.nodejs }}
Expand All @@ -98,24 +104,19 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Add arch env vars
- name: Build Node binaries lib
run: |
if [ "${{ matrix.arch }}" = "x64" ]; then
echo "ARCH=x86_64" >> $GITHUB_ENV
export ARCH=x86_64
else
echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV
export ARCH=${{ matrix.arch }}
fi
- name: Build Node binaries lib
run: |
export ARCH=${{ env.ARCH }}
pkg/mac/download-cpp-client.sh
npm install --ignore-scripts
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
Expand Down

0 comments on commit 608c25a

Please sign in to comment.