Skip to content

Commit 7879f81

Browse files
committed
upgrade keytar toolchain to modern Node versions, add support for packaging on arm
1 parent deae59a commit 7879f81

File tree

8 files changed

+3994
-2839
lines changed

8 files changed

+3994
-2839
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ on:
88
pull_request:
99
branches: [ master ]
1010

11+
permissions:
12+
contents: write # to allow workflow to publish release
13+
1114
jobs:
1215
build:
1316
name: ${{ matrix.friendlyName }}
14-
env:
15-
CC: "clang"
16-
CXX: "clang++"
17-
npm_config_clang: "1"
1817

1918
strategy:
2019
matrix:
21-
node-version: [15.x]
20+
node-version: [22.x]
2221
os: [ubuntu-20.04, windows-2019, macos-latest]
2322
include:
2423
- os: ubuntu-20.04
@@ -31,9 +30,9 @@ jobs:
3130
runs-on: ${{ matrix.os }}
3231

3332
steps:
34-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v4
3534
- name: Use Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v1
35+
uses: actions/setup-node@v4
3736
with:
3837
node-version: ${{ matrix.node-version }}
3938
- run: |
@@ -44,16 +43,7 @@ jobs:
4443
if: ${{ matrix.os == 'ubuntu-20.04' }}
4544
name: Install additional dependencies
4645
47-
# This step can be removed as soon as official Windows arm64 builds are published:
48-
# https://github.com/nodejs/build/issues/2450#issuecomment-705853342
49-
- run: |
50-
$NodeVersion = (node --version) -replace '^.'
51-
$NodeFallbackVersion = "15.8.0"
52-
& .\script\download-node-lib-win-arm64.ps1 $NodeVersion $NodeFallbackVersion
53-
if: ${{ matrix.os == 'windows-2019' }}
54-
name: Install Windows arm64 node.lib
55-
56-
- run: npm install
46+
- run: npm ci
5747
name: Setup environment
5848

5949
- run: npm run build
@@ -93,6 +83,7 @@ jobs:
9383
docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-napi-ia32 && rm -rf build"
9484
docker build -t node-keytar/arm64-cross-compile docker/arm64-cross-compile
9585
docker run --rm -v ${PWD}:/project node-keytar/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-arm64 && rm -rf build"
86+
docker run --rm -v ${PWD}:/project node-keytar/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-arm && rm -rf build"
9687
docker build -t node-keytar/armv7l-cross-compile docker/armv7l-cross-compile
9788
docker run --rm -v ${PWD}:/project node-keytar/armv7l-cross-compile /bin/bash -c "cd /project && npm run prebuild-napi-armv7l"
9889
if: ${{ matrix.os == 'ubuntu-20.04' }}
@@ -103,10 +94,8 @@ jobs:
10394
name: List prebuilds
10495
10596
- name: Upload prebuilds to GitHub
106-
run: npm run upload
97+
run: npx prebuild --verbose --upload-all ${{ secrets.GITHUB_TOKEN }}
10798
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
108-
env:
109-
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11099

111100
alpine-build:
112101
runs-on: ubuntu-latest

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.15.1
1+
22.13.1

docker/arm64-cross-compile/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:buster
1+
FROM debian:bookworm
22

33
RUN dpkg --add-architecture arm64
44
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -25,5 +25,5 @@ ENV AS=/usr/bin/aarch64-linux-gnu-as \
2525
FC=/usr/bin/aarch64-linux-gnu-gfortran \
2626
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
2727

28-
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
28+
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
2929
RUN apt-get install -y nodejs

docker/armv7l-cross-compile/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:buster
1+
FROM debian:bookworm
22

33
RUN dpkg --add-architecture armhf
44
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -25,5 +25,5 @@ ENV AS=/usr/bin/arm-linux-gnueabihf-as \
2525
FC=/usr/bin/arm-linux-gnueabihf-gfortran \
2626
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
2727

28-
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
28+
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
2929
RUN apt-get install -y nodejs

docker/i386/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM i386/debian:stretch
1+
FROM i386/debian:bullseye
22

33
RUN apt-get update
44
RUN apt-get install --quiet --yes \
@@ -9,8 +9,9 @@ RUN apt-get install --quiet --yes \
99
python \
1010
libsecret-1-dev
1111

12-
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
13-
RUN apt-get install -y nodejs
12+
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/
13+
14+
RUN node -v
1415

1516
ENV CC clang
1617
ENV CXX clang++

0 commit comments

Comments
 (0)