Skip to content

v1.0.8

v1.0.8 #18

name: Build Node.js Shared Library
on:
release:
types: [created]
pull_request:
types: [opened, synchronize, reopened]
paths:
- '.github/workflows/build_node_shared.yml'
jobs:
build:
strategy:
matrix:
include:
# Linux x64 builds
- os: ubuntu-latest
platform: linux
arch: x64
compiler: gcc
container: ghcr.io/ten-framework/ten_building_ubuntu2204
lib_name: libnode.so.127
nproc_cmd: nproc
- os: ubuntu-latest
platform: linux
arch: x64
compiler: clang
container: ghcr.io/ten-framework/ten_building_ubuntu2204
lib_name: libnode.so.127
nproc_cmd: nproc
# Linux ARM64 builds
- os: ubuntu-24.04-arm
platform: linux
arch: arm64
compiler: gcc
container: ""
lib_name: libnode.so.127
nproc_cmd: nproc
- os: ubuntu-24.04-arm
platform: linux
arch: arm64
compiler: clang
container: ""
lib_name: libnode.so.127
nproc_cmd: nproc
# macOS x64 builds
# Note: macOS should use Clang (Apple's official toolchain), GCC has compatibility issues
- os: macos-13
platform: mac
arch: x64
compiler: clang
container: ""
lib_name: libnode.127.dylib
nproc_cmd: sysctl -n hw.ncpu
# macOS ARM64 builds
# Note: Apple Silicon only supports Clang
- os: macos-14
platform: mac
arch: arm64
compiler: clang
container: ""
lib_name: libnode.127.dylib
nproc_cmd: sysctl -n hw.ncpu
runs-on: ${{ matrix.os }}
container: ${{ matrix.container != '' && matrix.container || null }}
steps:
- name: Checkout Node.js
uses: actions/checkout@v4
with:
repository: nodejs/node
ref: v22.12.0
- name: Setup dependencies (Linux ARM64)
if: matrix.platform == 'linux' && matrix.arch == 'arm64'
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip build-essential
if [ "${{ matrix.compiler }}" = "clang" ]; then
sudo apt-get install -y clang
fi
- name: Setup Python (macOS)
if: matrix.platform == 'mac'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Configure and Build
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
export CC=gcc
export CXX=g++
else
export CC=clang
export CXX=clang++
fi
./configure --shared
make -j$(${{ matrix.nproc_cmd }})
- name: Package assets
if: startsWith(github.ref, 'refs/tags/')
run: |
cd out/Release
# Package shared libraries into zip archive
zip node-shared-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.compiler }}.zip ${{ matrix.lib_name }}
- name: Publish to release assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
out/Release/node-shared-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.compiler }}.zip