Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add armv71 support to prebuilds #1

Merged
merged 1 commit into from
Feb 3, 2025
Merged
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
76 changes: 49 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ on:
pull_request:
branches: [master]

permissions:
contents: write

jobs:
build:
name: ${{ matrix.friendlyName }}
env:
DISPLAY: ":99.0"
CC: "clang"
CXX: "clang++"
npm_config_clang: "1"
#env:
#DISPLAY: ":99.0"
#CC: "clang"
#CXX: "clang++"
#npm_config_clang: "1"

strategy:
fail-fast: false
matrix:
node-version: [15.x]
os: [ubuntu-18.04, windows-latest, macos-latest]
node-version: [22.x]
os: [ubuntu-20.04, windows-latest, macos-latest]
include:
- os: ubuntu-18.04
- os: ubuntu-20.04
friendlyName: Ubuntu
- os: windows-latest
friendlyName: Windows
Expand All @@ -33,22 +36,26 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

# This step can be removed as soon as official Windows arm64 builds are published:
# https://github.com/nodejs/build/issues/2450#issuecomment-705853342
- run: |
$NodeVersion = (node --version) -replace '^.'
$NodeFallbackVersion = "15.8.0"
& .\script\download-node-lib-win-arm64.ps1 $NodeVersion $NodeFallbackVersion
if: ${{ matrix.os == 'windows-latest' }}
name: Install Windows arm64 node.lib
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm install
- run: npm ci
name: Setup environment

- run: npm run build
Expand All @@ -62,7 +69,7 @@ jobs:

- run: npm run prebuild-napi-arm64
name: Prebuild (arm64)
if: ${{ matrix.os != 'ubuntu-18.04' }}
if: ${{ matrix.os != 'ubuntu-20.04' }}

- run: npm run prebuild-napi-ia32
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -74,11 +81,13 @@ jobs:
docker run --rm -v ${PWD}:/project node-fs-admin/i386 /bin/bash -c "cd /project && npm run prebuild-napi-ia32 && rm -rf build"
docker build -t node-fs-admin/arm64-cross-compile docker/arm64-cross-compile
docker run --rm -v ${PWD}:/project node-fs-admin/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-arm64"
if: ${{ matrix.os == 'ubuntu-18.04' }}
docker build -t node-keytar/armv7l-cross-compile docker/armv7l-cross-compile
docker run --rm -v ${PWD}:/project node-keytar/armv7l-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-armv7l"
if: ${{ matrix.os == 'ubuntu-20.04' }}
name: Prebuild (Linux x86 + ARM64)

- run: |
ls prebuilds/
ls prebuilds/@shiftkey/
name: List prebuilds

- name: Upload prebuilds to GitHub
Expand All @@ -95,17 +104,30 @@ jobs:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- name: Use Node.js 15
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 15.x
node-version: 22.x
registry-url: "https://registry.npmjs.org"

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: sudo apt-get install libsecret-1-dev
name: Install additional dependencies

- run: npm install
- run: npm ci
name: Setup environment

- run: npm publish --access public
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: javascript, cpp

Expand All @@ -30,4 +30,4 @@ jobs:

# Run code analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.swp
*.log
*~
prebuilds/
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.15.1
22.13.1
6 changes: 3 additions & 3 deletions docker/arm64-cross-compile/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM debian:buster
FROM debian:bookworm

RUN dpkg --add-architecture arm64
RUN apt-get update && apt-get install -y --no-install-recommends \
crossbuild-essential-arm64 \
python \
python3 \
git \
pkg-config \
fakeroot \
Expand All @@ -25,5 +25,5 @@ ENV AS=/usr/bin/aarch64-linux-gnu-as \
FC=/usr/bin/aarch64-linux-gnu-gfortran \
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig

RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
RUN apt-get install -y nodejs
29 changes: 29 additions & 0 deletions docker/armv7l-cross-compile/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM debian:bookworm

RUN dpkg --add-architecture armhf
RUN apt-get update && apt-get install -y --no-install-recommends \
crossbuild-essential-armhf \
python3 \
git \
pkg-config \
fakeroot \
rpm \
ca-certificates \
libx11-dev:armhf \
libx11-xcb-dev:armhf \
libxkbfile-dev:armhf \
libsecret-1-dev:armhf \
curl

ENV AS=/usr/bin/arm-linux-gnueabihf-as \
STRIP=/usr/bin/arm-linux-gnueabihf-strip \
AR=/usr/bin/arm-linux-gnueabihf-ar \
CC=/usr/bin/arm-linux-gnueabihf-gcc \
CPP=/usr/bin/arm-linux-gnueabihf-cpp \
CXX=/usr/bin/arm-linux-gnueabihf-g++ \
LD=/usr/bin/arm-linux-gnueabihf-ld \
FC=/usr/bin/arm-linux-gnueabihf-gfortran \
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig

RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
RUN apt-get install -y nodejs
7 changes: 4 additions & 3 deletions docker/i386/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM i386/debian:stretch
FROM i386/debian:bullseye

RUN apt-get update
RUN apt-get install --quiet --yes \
Expand All @@ -9,8 +9,9 @@ RUN apt-get install --quiet --yes \
python \
libsecret-1-dev

RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
RUN apt-get install -y nodejs
RUN curl -sL 'https://unofficial-builds.nodejs.org/download/release/v20.12.2/node-v20.12.2-linux-x86.tar.xz' | xzcat | tar -vx --strip-components=1 -C /usr/local/

RUN node -v

ENV CC clang
ENV CXX clang++
Expand Down
Loading
Loading