Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
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
34 changes: 27 additions & 7 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ on:
description: The fully qualified name of the repository to check out the commit from
type: string
default: ${{ github.repository }}
prebuild_count:
required: true
description: How many prebuilt versions are expected to be generated
type: number
node_version:
required: false
description: Version of Node to use for setup-node
type: string
default: 20.x
default: lts/*

permissions:
contents: read
Expand Down Expand Up @@ -62,27 +66,28 @@ jobs:

- name: debian-x86_64
os: ubuntu-latest
BASE_IMAGE: library/debian:11.7-slim
BASE_IMAGE: library/debian:bullseye-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: x86_64

- name: debian-i386
os: ubuntu-latest
BASE_IMAGE: i386/debian:11.7-slim
BASE_IMAGE: i386/debian:bullseye-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: i386

- name: debian-arm32v6
os: ubuntu-latest
BASE_IMAGE: balenalib/raspberry-pi-debian:bullseye
BASE_IMAGE: balenalib/raspberrypi3-debian:bullseye
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: arm

- name: debian-arm64v8
os: ubuntu-latest
BASE_IMAGE: arm64v8/debian:11.7-slim
BASE_IMAGE: arm64v8/debian:bullseye
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: aarch64
PLATFORM: --platform=linux/arm64

- name: darwin-x86_64
os: macOS-latest
Expand Down Expand Up @@ -112,10 +117,10 @@ jobs:
sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static:register --reset

- name: Linux - Build Docker Image
- name: Linux - Build Docker Image ${{ matrix.DOCKERFILE }} - ${{ matrix.BASE_IMAGE }} - ${{ matrix.QEMU_ARCH }}
if: runner.os == 'Linux'
run: |
docker build -f .prebuild/${{ matrix.DOCKERFILE }} --build-arg BASE_IMAGE=${{ matrix.BASE_IMAGE }} --build-arg QEMU_ARCH=${{ matrix.QEMU_ARCH }} -t multiarch-build .
docker build -f .prebuild/${{ matrix.DOCKERFILE }} --build-arg BASE_IMAGE=${{ matrix.BASE_IMAGE }} --build-arg QEMU_ARCH=${{ matrix.QEMU_ARCH }} -t multiarch-build ${{ matrix.PLATFORM }} .

- name: Linux - Prebuild Binaries
if: runner.os == 'Linux'
Expand Down Expand Up @@ -143,6 +148,21 @@ jobs:
yarn install --ignore-scripts --ignore-engines
node .prebuild/buildify-windows.js

- name: "Check file existence"
id: check_files
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
files: "prebuilds/*/node*node"
fail: ${{ runner.os != 'Windows' }}

- name: Check NPM prebuilds exist
if: steps.check_files.outputs.files_exists == 'true'
shell: bash
run: |
fileCount=$(ls prebuilds/*/node*node | wc -l)
echo "NPM Prebuild count ${fileCount}"
if [ "$fileCount" -ne ${{ inputs.prebuild_count }} ]; then echo "::warning::Release NPM Prebuild count ${fileCount}, expected ${{ inputs.prebuild_count }}"; else echo "::notice::Release NPM Prebuild count ${fileCount}, expected ${{ inputs.prebuild_count }}"; fi

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ matrix.name }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
# Sadly, we cannot use environment variables here
ref: ${{ github.head_ref || github.ref }}
repository: ${{ github.repository }}
node_version: 22.x
prebuild_count: 3
node_version: lts/*
test:
needs: [prebuild]
runs-on: ubuntu-latest
Expand All @@ -35,7 +36,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22.x
node-version: lts/*
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: prebuilds
Expand Down
2 changes: 1 addition & 1 deletion .prebuild/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-library/node:15-alpine}
FROM ${BASE_IMAGE:-library/node:22-alpine}

ARG QEMU_ARCH
ENV QEMU_ARCH=${QEMU_ARCH:-x86_64}
Expand Down
22 changes: 12 additions & 10 deletions .prebuild/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-library/debian:11.7-slim}
FROM ${BASE_IMAGE:-library/debian:bookworm-slim}

ARG QEMU_ARCH
ENV QEMU_ARCH=${QEMU_ARCH:-x86_64}

COPY .prebuild/qemu/qemu-${QEMU_ARCH}-static /usr/bin/

RUN apt-get update \
&& apt-get install -y gcc g++ make python3 curl
RUN apt-get update && apt-get install -y gcc g++ make python3 curl

RUN [ "$(uname -m)" = "x86_64" ] && apt-get install -y g++-multilib gcc-multilib || echo "ok"

ENV NODE_VERSION 15.8.0
## Linux 32 bit support was dropped with NodeJS 18.4.0

ENV NODE_VERSION=22.12.0

RUN case "${QEMU_ARCH}" in \
x86_64) NODE_ARCH='x64';; \
arm) NODE_ARCH='armv6l';; \
arm) NODE_ARCH='armv7l';; \
aarch64) NODE_ARCH='arm64';; \
i386) NODE_ARCH='x86';; \
i386) NODE_ARCH='x86'; NODE_VERSION='18.4.0';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
&& [ "$NODE_ARCH" = "armv6l" -o "$NODE_ARCH" = "x86" ] && curl -SLO "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" || curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
&& [ "$NODE_ARCH" = "armv6l" -o "$NODE_ARCH" = "x86" ] && curl -k -SLO "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" || curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
&& echo "Installing NodeJS node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
&& tar -xzf "node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& npm set prefix /usr/local \
&& npm config set unsafe-perm true
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs

RUN npm set prefix /usr/local

RUN mkdir /node-pty
WORKDIR /node-pty
Expand Down
5 changes: 1 addition & 4 deletions .prebuild/buildify-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ const cwd = path.resolve(__dirname, "../");

// define build targets
const nodeBuildTargets = [
"17.0.1",
"18.0.0",
"19.0.0",
"20.0.0",
"21.0.0",
"22.0.0",
"24.0.0",
].reduce((acc, ver) => {
acc.push("-t");
acc.push(ver);
Expand Down
5 changes: 1 addition & 4 deletions .prebuild/buildify.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ const cwd = path.resolve(__dirname, "../");

// define build targets
const nodeBuildTargets = [
"17.0.1",
"18.0.0",
"19.0.0",
"20.0.0",
"21.0.0",
"22.0.0",
"24.0.0",
].reduce((acc, ver) => {
acc.push("-t");
acc.push(ver);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ When `node-pty-prebuilt-multiarch` is installed as a package dependency, the ins
| Windows | ia32, x64 |


*We only provide prebuilt binaries for Node.js 10 and Electron 5.0.0 or higher.
*We only provide prebuilt binaries for Node.js 20 or higher, and only for versions that are not EOL.

## License

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"eslint": "^6.8.0",
"mocha": "^10.4.0",
"node-abi": "4.2.0",
"node-gyp": "^9.3.0",
"prebuild": "^12.1.0",
"node-gyp": "^11.2.0",
"prebuild": "^13.0.1",
"prebuildify": "^5.0.1",
"ps-list": "^6.0.0",
"typescript": "^3.8.3"
Expand Down
Loading
Loading