Skip to content
Open
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
15 changes: 15 additions & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
update:
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
include:
Expand All @@ -19,6 +20,17 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- uses: actions/checkout@v6

- name: Read version from version.txt
Expand Down Expand Up @@ -52,8 +64,11 @@ jobs:
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
mkdir -p "$CCACHE_DIR"

export DEBUG=1
export ASAN=1
bash scripts/build.sh

# TODO: Implement debug and release
- name: Create archive
run: |
cd node/out/Release
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
update:
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
include:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
update:
name: Windows
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
include:
Expand Down
21 changes: 20 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,52 @@
#!/bin/bash
set -e

# Version
if [ -z "$NODE_VERSION" ]; then
NODE_VERSION=$(head -n 1 version.txt | tr -d '\r\n')
fi

# Operative System
if [ -z "$OS" ]; then
if [ "$(uname)" = "Darwin" ]; then
OS="mac"
else
OS="linux"
fi
fi

# Architecture
if [ "$ARCH" = "amd64" ]; then
NODE_ARCH="x64"
else
NODE_ARCH="arm64"
fi

# Cores
if [ "$(uname)" = "Darwin" ]; then
CORES=$(sysctl -n hw.ncpu)
else
CORES=$(nproc)
fi

# Debug
if [ "${DEBUG+x}" ]; then
BUILD_DEBUG=--debug
else
BUILD_DEBUG=
fi

# Address Sanitizer
if [ "${ASAN+x}" ]; then
BUILD_ASAN=--enable-asan
else
BUILD_ASAN=
fi

if [ ! -d "node" ]; then
git clone https://github.com/nodejs/node --branch "$NODE_VERSION" --depth=1
fi

cd node
./configure --shared --dest-cpu "$NODE_ARCH" --dest-os "$OS"
./configure --shared --dest-cpu "$NODE_ARCH" --dest-os "$OS" $BUILD_DEBUG $BUILD_ASAN
make -j$CORES
Loading