Skip to content
Merged
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
44 changes: 37 additions & 7 deletions .github/workflows/build_node_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,49 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
container:
image: ghcr.io/ten-framework/ten_building_ubuntu2204
include:
# Linux 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
# macOS x64 builds
- os: macos-13
platform: mac
arch: x64
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 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
Expand All @@ -35,19 +65,19 @@ jobs:

./configure --shared

make -j$(nproc)
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-linux-x64-${{ matrix.compiler }}.zip libnode.so.127
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-linux-x64-${{ matrix.compiler }}.zip
out/Release/node-shared-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.compiler }}.zip