Skip to content

Commit

Permalink
chore: bump to node 20 (#13801)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Nov 15, 2023
1 parent 6bd2444 commit 78d9027
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/devcontainers/images/blob/v0.2.24/src/javascript-node/.devcontainer/devcontainer.json
// https://github.com/devcontainers/images/blob/v0.3.24/src/javascript-node/.devcontainer/devcontainer.json
{
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/javascript-node:18-bullseye",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20-bookworm",

// Configure tool-specific properties.
"customizations": {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
version: 8
- uses: actions/setup-node@v4
with:
# pinned to 18 until https://github.com/compulim/version-from-git/issues/16 is fixed
node-version: 18
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]
node-version: [ 18, 20, 21 ]
name: Jest on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v4
Expand All @@ -51,7 +51,7 @@ jobs:
env:
REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/
- name: Upload coverage to Codecov
if: ${{ matrix.node-version == '18' }}
if: ${{ matrix.node-version == '20' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos as documented, but seems broken
Expand All @@ -62,7 +62,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]
node-version: [ 18, 20, 21 ]
chromium:
- name: bundled Chromium
dependency: ''
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
if: ${{ matrix.chromium.dependency != '' }}
# 'chromium-browser' from Ubuntu APT repo is a dummy package. Its version (85.0.4183.83) means
# nothing since it calls Snap (disgusting!) to install Chromium, which should be up-to-date.
# That's not really a problem since the Chromium-bundled Docker image is based on Debian bullseye,
# That's not really a problem since the Chromium-bundled Docker image is based on Debian bookworm,
# which provides up-to-date native packages.
run: |
set -ex
Expand All @@ -111,7 +111,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]
node-version: [ 18, 20, 21 ]
defaults:
run:
working-directory: website
Expand All @@ -137,7 +137,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]
node-version: [ 18, 20, 21 ]
name: Build radar and maintainer on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v4
Expand All @@ -153,7 +153,7 @@ jobs:
run: npm run build:all

automerge:
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
if: github.triggering_actor == 'dependabot[bot]' && github.event_name == 'pull_request'
needs: [ jest, puppeteer, docs, all ]
runs-on: ubuntu-latest
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
lts/iron
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bullseye AS dep-builder
FROM node:20-bookworm AS dep-builder
# Here we use the non-slim image to provide build-time deps (compilers and python), thus no need to install later.
# This effectively speeds up qemu-based cross-build.

Expand Down Expand Up @@ -28,11 +28,11 @@ RUN \

# ---------------------------------------------------------------------------------------------------------------------

FROM debian:bullseye-slim AS dep-version-parser
FROM debian:bookworm-slim AS dep-version-parser
# This stage is necessary to limit the cache miss scope.
# With this stage, any modification to package.json won't break the build cache of the next two stages as long as the
# version unchanged.
# node:18-bullseye-slim is based on debian:bullseye-slim so this stage would not cause any additional download.
# node:20-bookworm-slim is based on debian:bookworm-slim so this stage would not cause any additional download.

WORKDIR /ver
COPY ./package.json /app/
Expand All @@ -44,7 +44,7 @@ RUN \

# ---------------------------------------------------------------------------------------------------------------------

FROM node:18-bullseye-slim AS docker-minifier
FROM node:20-bookworm-slim AS docker-minifier
# The stage is used to further reduce the image size by removing unused files.

WORKDIR /minifier
Expand Down Expand Up @@ -77,7 +77,7 @@ RUN \

# ---------------------------------------------------------------------------------------------------------------------

FROM node:18-bullseye-slim AS chromium-downloader
FROM node:20-bookworm-slim AS chromium-downloader
# This stage is necessary to improve build concurrency and minimize the image size.
# Yeah, downloading Chromium never needs those dependencies below.

Expand Down Expand Up @@ -109,7 +109,7 @@ RUN \

# ---------------------------------------------------------------------------------------------------------------------

FROM node:18-bullseye-slim AS app
FROM node:20-bookworm-slim AS app

LABEL org.opencontainers.image.authors="https://github.com/DIYgod/RSSHub"

Expand All @@ -123,7 +123,7 @@ ARG TARGETPLATFORM
ARG PUPPETEER_SKIP_DOWNLOAD=1
# https://pptr.dev/troubleshooting#chrome-headless-doesnt-launch-on-unix
# https://github.com/puppeteer/puppeteer/issues/7822
# https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#noteworthy-obsolete-packages
# https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#noteworthy-obsolete-packages
# The official recommended way to use Puppeteer on arm/arm64 is to install Chromium from the distribution repositories:
# https://github.com/puppeteer/puppeteer/blob/07391bbf5feaf85c191e1aa8aa78138dce84008d/packages/puppeteer-core/src/node/BrowserFetcher.ts#L128-L131
RUN \
Expand Down

0 comments on commit 78d9027

Please sign in to comment.