deploy on node 20 (#9799)

* deploy on node 20

* use appropriate npm versions for each node version
This commit is contained in:
chris48s
2023-12-30 19:03:34 +00:00
committed by GitHub
parent 3300e4a09d
commit 01de8910cd
22 changed files with 45 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
FROM node:18-bullseye
FROM node:20-bullseye
RUN apt-get update
RUN apt-get install -y jq

View File

@@ -2,8 +2,12 @@ name: 'Set up project'
description: 'Set up project'
inputs:
node-version:
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
description: 'Version Spec of the node version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
required: true
npm-version:
description: 'Version Spec of the npm version to use. Examples: 9.x, 10.2.3, >=10.1.0.'
required: false
default: '^10'
cypress:
description: 'Install Cypress binary (boolean)'
type: boolean
@@ -19,8 +23,8 @@ runs:
with:
node-version: ${{ inputs.node-version }}
- name: Install NPM 9
run: npm install -g npm@^9.0.0
- name: Install NPM ${{ inputs.npm-version }}
run: npm install -g npm@${{ inputs.npm-version }}
shell: bash
- name: Install dependencies

View File

@@ -17,7 +17,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
cypress: true
- run: .github/scripts/check-docusaurus-versions.sh

View File

@@ -19,7 +19,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
- name: Danger
run: npm run danger ci

View File

@@ -19,7 +19,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
- name: Build
run: npm run build-docs

View File

@@ -40,7 +40,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
cypress: false
- name: Output debug info

View File

@@ -26,7 +26,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
cypress: true
- name: Run tests

View File

@@ -1,4 +1,4 @@
name: Integration@node 20
name: Integration@node 21
on:
pull_request:
types: [opened, reopened, synchronize]
@@ -8,7 +8,7 @@ on:
- 'dependabot/**'
jobs:
test-integration-20:
test-integration-21:
runs-on: ubuntu-latest
env:
PAT_EXISTS: ${{ secrets.GH_PAT != '' }}
@@ -35,7 +35,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 20
node-version: 21
env:
NPM_CONFIG_ENGINE_STRICT: 'false'

View File

@@ -35,7 +35,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
- name: Integration Tests (with PAT)
if: ${{ env.PAT_EXISTS == 'true' }}

View File

@@ -17,7 +17,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
- name: ESLint
if: always()

View File

@@ -1,4 +1,4 @@
name: Main@node 20
name: Main@node 21
on:
pull_request:
types: [opened, reopened, synchronize]
@@ -8,7 +8,7 @@ on:
- 'dependabot/**'
jobs:
test-main-20:
test-main-21:
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -17,7 +17,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 20
node-version: 21
env:
NPM_CONFIG_ENGINE_STRICT: 'false'

View File

@@ -22,7 +22,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
- name: Core tests
uses: ./.github/actions/core-tests

View File

@@ -14,11 +14,14 @@ jobs:
matrix:
include:
- node: '16'
npm: '^9'
engine-strict: 'false'
- node: '18'
engine-strict: 'true'
- node: '20'
npm: '^9'
engine-strict: 'false'
- node: '20'
npm: '^10'
engine-strict: 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -27,6 +30,7 @@ jobs:
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node }}
npm-version: ${{ matrix.npm }}
env:
NPM_CONFIG_ENGINE_STRICT: ${{ matrix.engine-strict }}

View File

@@ -1,4 +1,4 @@
name: Services@node 20
name: Services@node 21
on:
pull_request:
types: [opened, edited, reopened, synchronize]
@@ -7,7 +7,7 @@ on:
- 'gh-readonly-queue/**'
jobs:
test-services-20:
test-services-21:
runs-on: ubuntu-latest
steps:
@@ -17,7 +17,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 20
node-version: 21
env:
NPM_CONFIG_ENGINE_STRICT: 'false'

View File

@@ -17,7 +17,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
- name: Service tests (triggered from local branch)
if: github.event.pull_request.head.repo.full_name == github.repository

View File

@@ -19,7 +19,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 18
node-version: 20
- name: Check for new GitHub API version
run: node scripts/update-github-api.js

View File

@@ -1,4 +1,4 @@
FROM node:18-alpine AS Builder
FROM node:20-alpine AS Builder
RUN mkdir -p /usr/src/app
RUN mkdir /usr/src/app/private
@@ -19,7 +19,7 @@ RUN npm prune --omit=dev
RUN npm cache clean --force
# Use multi-stage build to reduce size
FROM node:18-alpine
FROM node:20-alpine
ARG version=dev
ENV DOCKER_SHIELDS_VERSION=$version

View File

@@ -98,8 +98,8 @@ If you intend on reporting or contributing a fix related to security vulnerabili
## Development
1. Install Node 18 or later. You can use the [package manager][] of your choice.
Tests need to pass in Node 18 and 20.
1. Install Node 20 or later. You can use the [package manager][] of your choice.
Tests need to pass in Node 20 and 21.
2. Clone this repository.
3. Run `npm ci` to install the dependencies.
4. Run `npm start` to start the badge server and the frontend dev server.

View File

@@ -25,7 +25,7 @@ and learn about the [GitHub workflow](http://try.github.io/).
#### Node, NPM
Node >=18 and NPM 9.x is required. If you don't already have them,
Node >=20 and NPM 9.x or 10.x is required. If you don't already have them,
install node and npm: https://nodejs.org/en/download/
### Setup a dev install

View File

@@ -4,13 +4,13 @@ This document describes how to host your own shields server either from source o
## Installing from Source
You will need Node 18 or later, which you can install using a
You will need Node 20 or later, which you can install using a
[package manager][].
On Ubuntu / Debian:
```sh
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -; sudo apt-get install -y nodejs
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -; sudo apt-get install -y nodejs
```
```sh

4
package-lock.json generated
View File

@@ -126,8 +126,8 @@
"url": "^0.11.3"
},
"engines": {
"node": "^18.16.0",
"npm": "^9.0.0"
"node": "^20.10.0",
"npm": "^9.0.0 || ^10.0.0"
}
},
"badge-maker": {

View File

@@ -97,7 +97,7 @@
"pretest": "cross-env BASE_URL=http://localhost:8080 run-s --silent defs",
"test": "run-s --silent --continue-on-error lint test:package test:core test:entrypoint check-types:package prettier:check",
"check-types:package": "tsd badge-maker",
"depcheck": "check-node-version --node \">= 18.0\"",
"depcheck": "check-node-version --node \">= 20.0\"",
"prebuild": "run-s --silent depcheck",
"defs": "node scripts/export-openapi-cli.js",
"build": "rimraf public && run-s defs docusaurus:build",
@@ -213,8 +213,8 @@
"url": "^0.11.3"
},
"engines": {
"node": "^18.16.0",
"npm": "^9.0.0"
"node": "^20.10.0",
"npm": "^9.0.0 || ^10.0.0"
},
"type": "module",
"collective": {