Skip to content

Commit 69cb112

Browse files
committed
Add macOS x64 support to build workflow
1 parent 3507843 commit 69cb112

1 file changed

Lines changed: 37 additions & 7 deletions

File tree

.github/workflows/build_node_shared.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,49 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
1413
strategy:
1514
matrix:
16-
compiler: [gcc, clang]
17-
container:
18-
image: ghcr.io/ten-framework/ten_building_ubuntu2204
15+
include:
16+
# Linux builds
17+
- os: ubuntu-latest
18+
platform: linux
19+
arch: x64
20+
compiler: gcc
21+
container: ghcr.io/ten-framework/ten_building_ubuntu2204
22+
lib_name: libnode.so.127
23+
nproc_cmd: nproc
24+
- os: ubuntu-latest
25+
platform: linux
26+
arch: x64
27+
compiler: clang
28+
container: ghcr.io/ten-framework/ten_building_ubuntu2204
29+
lib_name: libnode.so.127
30+
nproc_cmd: nproc
31+
# macOS x64 builds
32+
- os: macos-13
33+
platform: mac
34+
arch: x64
35+
compiler: clang
36+
container: ""
37+
lib_name: libnode.127.dylib
38+
nproc_cmd: sysctl -n hw.ncpu
39+
40+
runs-on: ${{ matrix.os }}
41+
container: ${{ matrix.container != '' && matrix.container || null }}
42+
1943
steps:
2044
- name: Checkout Node.js
2145
uses: actions/checkout@v4
2246
with:
2347
repository: nodejs/node
2448
ref: v22.12.0
2549

50+
- name: Install dependencies (macOS)
51+
if: matrix.platform == 'mac'
52+
run: |
53+
brew install python@3.11
54+
brew link python@3.11
55+
2656
- name: Configure and Build
2757
run: |
2858
if [ "${{ matrix.compiler }}" = "gcc" ]; then
@@ -35,19 +65,19 @@ jobs:
3565
3666
./configure --shared
3767
38-
make -j$(nproc)
68+
make -j$(${{ matrix.nproc_cmd }})
3969
4070
- name: Package assets
4171
if: startsWith(github.ref, 'refs/tags/')
4272
run: |
4373
cd out/Release
4474
4575
# Package shared libraries into zip archive
46-
zip node-shared-linux-x64-${{ matrix.compiler }}.zip libnode.so.127
76+
zip node-shared-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.compiler }}.zip ${{ matrix.lib_name }}
4777
4878
- name: Publish to release assets
4979
uses: softprops/action-gh-release@v2
5080
if: startsWith(github.ref, 'refs/tags/')
5181
with:
5282
files: |
53-
out/Release/node-shared-linux-x64-${{ matrix.compiler }}.zip
83+
out/Release/node-shared-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.compiler }}.zip

0 commit comments

Comments
 (0)