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
54 changes: 48 additions & 6 deletions .github/workflows/build_node_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
container: ghcr.io/ten-framework/ten_building_ubuntu2204
lib_name: libnode.so.127
nproc_cmd: nproc
# Linux ARM64 builds
- os: ubuntu-latest-arm
# Linux ARM64 builds (using QEMU)
- os: ubuntu-latest
platform: linux
arch: arm64
compiler: gcc
container: ghcr.io/ten-framework/ten_building_ubuntu2204
container: ""
lib_name: libnode.so.127
nproc_cmd: nproc
- os: ubuntu-latest-arm
- os: ubuntu-latest
platform: linux
arch: arm64
compiler: clang
container: ghcr.io/ten-framework/ten_building_ubuntu2204
container: ""
lib_name: libnode.so.127
nproc_cmd: nproc
# macOS x64 builds
Expand Down Expand Up @@ -72,13 +72,50 @@
repository: nodejs/node
ref: v22.12.0

- name: Create out directory (Linux ARM64)
if: matrix.platform == 'linux' && matrix.arch == 'arm64'
run: |
# Due to the use of QEMU, running as root inside the Docker container
# is required. However, outside the container, the user is not root.
# This causes issues when trying to handle the contents of the out/
# folder from outside the container. To resolve this, the out/ folder
# is first created by a regular non-root user to prevent it from being
# created during the build stage, thus avoiding permission issues with
# the out/ folder being created by the root user.
mkdir -p out/Release
- name: Set up QEMU (Linux ARM64)
if: matrix.platform == 'linux' && matrix.arch == 'arm64'
uses: docker/setup-qemu-action@v3

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Build Node.js Shared Library' step
Uses Step
uses 'docker/setup-qemu-action' with ref 'v3', not a pinned commit hash
with:
platforms: arm64

- name: Setup Python (macOS)
if: matrix.platform == 'mac'
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Configure and Build
- name: Configure and Build (Linux ARM64 with QEMU)
if: matrix.platform == 'linux' && matrix.arch == 'arm64'
run: |
docker run --rm --platform linux/arm64 \
-v $(pwd):${{ github.workspace }} -w ${{ github.workspace }} \
ghcr.io/ten-framework/ten_building_ubuntu2204 \
bash -c "
if [ '${{ matrix.compiler }}' = 'gcc' ]; then
export CC=gcc
export CXX=g++
else
export CC=clang
export CXX=clang++
fi && \
./configure --shared && \
make -j\$(nproc)
"
- name: Configure and Build (Linux x64 and macOS)
if: matrix.platform != 'linux' || matrix.arch != 'arm64'
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
export CC=gcc
Expand All @@ -92,6 +129,11 @@
make -j$(${{ matrix.nproc_cmd }})
- name: Fix permissions for build outputs (Linux ARM64)
if: matrix.platform == 'linux' && matrix.arch == 'arm64'
run: |
sudo chown -R "$(id -u)":"$(id -g)" out/Release
- name: Package assets
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand Down
Loading