Skip to content

Commit

Permalink
Drop support for Node.js 14 and 16, require >= 18.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Sep 22, 2023
1 parent eefaa99 commit 3b58bc6
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 52 deletions.
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ version: 2.1
workflows:
build:
jobs:
- linux-arm64-glibc-node-14:
- linux-arm64-glibc-node-18:
filters:
tags:
only: /^v.*/
- linux-arm64-musl-node-14:
- linux-arm64-musl-node-18:
filters:
tags:
only: /^v.*/
- linux-arm64-glibc-node-18:
- linux-arm64-glibc-node-20:
filters:
tags:
only: /^v.*/
- linux-arm64-musl-node-18:
- linux-arm64-musl-node-20:
filters:
tags:
only: /^v.*/

jobs:
linux-arm64-glibc-node-14:
linux-arm64-glibc-node-18:
resource_class: arm.medium
machine:
image: ubuntu-2004:current
Expand All @@ -31,12 +31,12 @@ jobs:
sudo docker run -dit --name sharp --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp arm64v8/debian:bullseye
sudo docker exec sharp sh -c "apt-get update && apt-get install -y build-essential git python3 curl fonts-noto-core"
sudo docker exec sharp sh -c "curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -"
sudo docker exec sharp sh -c "echo 'deb https://deb.nodesource.com/node_14.x sid main' >/etc/apt/sources.list.d/nodesource.list"
sudo docker exec sharp sh -c "echo 'deb https://deb.nodesource.com/node_18.x sid main' >/etc/apt/sources.list.d/nodesource.list"
sudo docker exec sharp sh -c "apt-get update && apt-get install -y nodejs"
- run: sudo docker exec sharp sh -c "npm install --build-from-source --unsafe-perm"
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --runtime napi --target 7 --upload=$prebuild_upload\" || true"
linux-arm64-glibc-node-18:
linux-arm64-glibc-node-20:
resource_class: arm.medium
machine:
image: ubuntu-2004:current
Expand All @@ -46,32 +46,32 @@ jobs:
sudo docker run -dit --name sharp --workdir /mnt/sharp arm64v8/debian:bullseye
sudo docker exec sharp sh -c "apt-get update && apt-get install -y build-essential git python3 curl fonts-noto-core"
sudo docker exec sharp sh -c "curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -"
sudo docker exec sharp sh -c "echo 'deb https://deb.nodesource.com/node_18.x sid main' >/etc/apt/sources.list.d/nodesource.list"
sudo docker exec sharp sh -c "echo 'deb https://deb.nodesource.com/node_20.x sid main' >/etc/apt/sources.list.d/nodesource.list"
sudo docker exec sharp sh -c "apt-get update && apt-get install -y nodejs"
sudo docker exec sharp sh -c "mkdir -p /mnt/sharp"
sudo docker cp . sharp:/mnt/sharp/.
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
linux-arm64-musl-node-14:
linux-arm64-musl-node-18:
resource_class: arm.medium
machine:
image: ubuntu-2004:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:14-alpine3.12
sudo docker run -dit --name sharp --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:18-alpine3.17
sudo docker exec sharp sh -c "apk add build-base git python3 font-noto --update-cache"
- run: sudo docker exec sharp sh -c "npm install --build-from-source --unsafe-perm"
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --runtime napi --target 7 --upload=$prebuild_upload\" || true"
linux-arm64-musl-node-18:
linux-arm64-musl-node-20:
resource_class: arm.medium
machine:
image: ubuntu-2004:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --workdir /mnt/sharp node:18-alpine3.14
sudo docker run -dit --name sharp --workdir /mnt/sharp node:20-alpine3.18
sudo docker exec sharp sh -c "apk add build-base git python3 font-noto --update-cache"
sudo docker exec sharp sh -c "mkdir -p /mnt/sharp"
sudo docker cp . sharp:/mnt/sharp/.
Expand Down
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ task:
- pkg upgrade -y
- pkg install -y devel/git devel/pkgconf graphics/vips www/node20 www/npm
install_script:
- npm install --build-from-source --unsafe-perm
- npm install --build-from-source
test_script:
- npm test
10 changes: 6 additions & 4 deletions .github/workflows/ci-darwin-arm64v8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ jobs:
CI:
permissions:
contents: write # for npx prebuild to make release
name: Node.js ${{ matrix.nodejs_version }} ${{ matrix.nodejs_arch }} ${{ matrix.prebuild && '- prebuild' }}
name: Node.js ${{ matrix.nodejs_version }} ${{ matrix.platform }} ${{ matrix.prebuild && '- prebuild' }}
runs-on: macos-m1
strategy:
fail-fast: false
matrix:
include:
- nodejs_version: 14
- nodejs_version: "^18.17.0"
nodejs_arch: x64
- nodejs_version: 18
platform: darwin-x64
- nodejs_version: "^18.17.0"
nodejs_arch: arm64
platform: darwin-arm64
prebuild: true
defaults:
run:
Expand All @@ -30,7 +32,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install
run: npm install --build-from-source --unsafe-perm
run: npm install --build-from-source
- name: Test
run: npm test
- name: Prebuild
Expand Down
52 changes: 24 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,56 @@ jobs:
CI:
permissions:
contents: write # for npx prebuild to make release
name: ${{ matrix.container || matrix.os }} - Node.js ${{ matrix.nodejs_version }} ${{ matrix.nodejs_arch }} ${{ matrix.prebuild && '- prebuild' }}
name: ${{ matrix.container || matrix.os }} - Node.js ${{ matrix.platform }} ${{ matrix.nodejs_arch }} ${{ matrix.prebuild && '- prebuild' }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
container: centos:7
nodejs_version: 14
container: rockylinux:8
nodejs_version: "^18.17.0"
platform: linux-x64
prebuild: true
- os: ubuntu-22.04
container: centos:7
nodejs_version: 16
- os: ubuntu-22.04
container: rockylinux:8
nodejs_version: 18
nodejs_version: "^20.3.0"
platform: linux-x64
- os: ubuntu-22.04
container: node:14-alpine3.12
container: node:18-alpine3.17
platform: linuxmusl-x64
prebuild: true
- os: ubuntu-22.04
container: node:16-alpine3.12
- os: ubuntu-22.04
container: node:18-alpine3.14
- os: macos-11
nodejs_version: 14
prebuild: true
nodejs_arch: x64
container: node:20-alpine3.18
platform: linuxmusl-x64
- os: macos-11
nodejs_version: 16
nodejs_version: "^18.17.0"
nodejs_arch: x64
platform: darwin-x64
prebuild: true
- os: macos-11
nodejs_version: 18
nodejs_version: "^20.3.0"
nodejs_arch: x64
platform: darwin-x64
- os: windows-2019
nodejs_version: 14
nodejs_version: "^18.17.0"
nodejs_arch: x86
platform: win32-ia32
prebuild: true
- os: windows-2019
nodejs_version: 16
nodejs_arch: x86
- os: windows-2019
nodejs_version: 18
nodejs_version: "^20.3.0"
nodejs_arch: x86
platform: win32-ia32
- os: windows-2019
nodejs_version: 14
nodejs_version: "^18.17.0"
nodejs_arch: x64
platform: win32-x64
prebuild: true
- os: windows-2019
nodejs_version: 16
nodejs_arch: x64
- os: windows-2019
nodejs_version: 18
nodejs_version: "^20.3.0"
nodejs_arch: x64
platform: win32-x64
steps:
- name: Dependencies (Linux glibc)
if: contains(matrix.container, 'centos')
Expand Down Expand Up @@ -96,7 +92,7 @@ jobs:
if: matrix.container
run: chown root.root .
- name: Install
run: npm install --build-from-source --unsafe-perm
run: npm install --build-from-source
- name: Test
run: npm test
- name: Prebuild
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Lanczos resampling ensures quality is not sacrificed for speed.
As well as image resizing, operations such as
rotation, extraction, compositing and gamma correction are available.

Most modern macOS, Windows and Linux systems running Node.js >= 14.15.0
Most modern macOS, Windows and Linux systems running Node.js >= 18.17.0
do not require any additional install or runtime dependencies.

## Documentation
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v0.33 - *gauge*

Requires libvips v8.14.5

### v0.33.0 - TBD

* Drop support for Node.js 14 and 16, now requires Node.js >= 18.17.0

## v0.32 - *flow*

Requires libvips v8.14.5
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ yarn add sharp

## Prerequisites

* Node.js >= 14.15.0
* Node.js >= 18.17.0

## Prebuilt binaries

Expand Down
2 changes: 1 addition & 1 deletion docs/search-index.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"dependencies": {
"color": "^4.2.3",
"detect-libc": "^2.0.2",
"node-addon-api": "^6.1.0",
"node-addon-api": "^7.0.0",
"prebuild-install": "^7.1.1",
"semver": "^7.5.4",
"simple-get": "^4.0.1",
Expand Down Expand Up @@ -177,7 +177,7 @@
"target": 7
},
"engines": {
"node": ">=14.15.0"
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
Expand Down

0 comments on commit 3b58bc6

Please sign in to comment.