Skip to content

Commit

Permalink
build!: require node v20 (#30291)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice authored and rarkins committed Jul 23, 2024
1 parent fcd78f2 commit 82b75c6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ concurrency:

env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
NODE_VERSION_TEST: 18
NODE_VERSION_BUILD: 20
NODE_VERSION: 20
DRY_RUN: true
TEST_LEGACY_DECRYPTION: true
SPARSE_CHECKOUT: |-
Expand Down Expand Up @@ -106,13 +105,13 @@ jobs:
with:
repo: ${{ github.event.repository.full_name }}
token: ${{ github.token }}
node-version: ${{ env.NODE_VERSION_TEST }}
node-version: ${{ env.NODE_VERSION }}

- name: Prefetch test modules for `ubuntu-latest`
id: setup-node
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION_TEST }}
node-version: ${{ env.NODE_VERSION }}
os: ${{ runner.os }}
save-cache: true

Expand All @@ -129,7 +128,7 @@ jobs:
runs-on: ubuntu-latest

outputs:
node-version: ${{ env.NODE_VERSION_BUILD }}
node-version: ${{ env.NODE_VERSION }}

steps:
- name: Checkout code
Expand All @@ -142,7 +141,7 @@ jobs:
- name: Prefetch build modules for `ubuntu-latest`
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION_BUILD }}
node-version: ${{ env.NODE_VERSION }}
os: ${{ runner.os }}
save-cache: true

Expand Down Expand Up @@ -182,7 +181,7 @@ jobs:
if: needs.setup.outputs.os-matrix-is-full && runner.os != 'Linux'
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION_TEST }}
node-version: ${{ env.NODE_VERSION }}
os: ${{ runner.os }}
save-cache: true

Expand Down Expand Up @@ -362,7 +361,7 @@ jobs:
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION_TEST }}
node-version: ${{ env.NODE_VERSION }}
os: ${{ runner.os }}

- name: Cache jest
Expand All @@ -373,7 +372,7 @@ jobs:
jest-cache-${{
runner.os
}}-${{
env.NODE_VERSION_TEST
env.NODE_VERSION
}}-${{
hashFiles('pnpm-lock.yaml')
}}-${{
Expand Down Expand Up @@ -617,7 +616,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: ${{ env.NODE_VERSION_TEST }}
node-version: ${{ env.NODE_VERSION }}

- name: Download package
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
Expand Down
8 changes: 1 addition & 7 deletions docs/development/bump-node-major.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@

## Add new NodeJS version

- Add new version via `package.json>engines>node` and `package.json>engines-next>node`
- Add new version via `package.json>engines>node`
- Update the node version in the [local-development](./local-development.md) docs
- Update the node version in the GitHub Actions workflow files

## Deprecate old NodeJS version

- Deprecate old LTS via `package.json>engines-next>node`
- Update the node version in the [local-development](./local-development.md) docs
- Remove the old node version in the GitHub Actions workflow files

## Remove old NodeJS version

- Update `package.json>engines>node`
Expand Down
2 changes: 1 addition & 1 deletion docs/development/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For example, if you think anything is unclear, or you think something needs to b
You need the following dependencies for local development:

- Git `>=2.45.1`
- Node.js `^18.12.0 || >=20.0.0`
- Node.js `^20.15.1`
- pnpm `^9.0.0` (use corepack)
- C++ compiler

Expand Down
1 change: 0 additions & 1 deletion lib/types/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ export interface ModuleApi {
}

export type RenovatePackageJson = PackageJson & {
'engines-next': Record<string, string>;
version: string;
};
9 changes: 0 additions & 9 deletions lib/workers/global/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function haveReachedLimits(): boolean {
/* istanbul ignore next */
function checkEnv(): void {
const range = pkg.engines!.node!;
const rangeNext = pkg['engines-next']?.node;
if (process.release?.name !== 'node' || !process.versions?.node) {
logger.warn(
{ release: process.release, versions: process.versions },
Expand All @@ -82,14 +81,6 @@ function checkEnv(): void {
{ versions: process.versions, range },
'Unsupported node environment detected. Please update your node version.',
);
} else if (
rangeNext &&
!semver.satisfies(process.versions?.node, rangeNext)
) {
logger.warn(
{ versions: process.versions },
`Please upgrade the version of Node.js used to run Renovate to satisfy "${rangeNext}". Support for your current version will be removed in Renovate's next major release.`,
);
}
}

Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,9 @@
},
"homepage": "https://renovatebot.com",
"engines": {
"node": "^18.12.0 || >=20.0.0",
"node": "^20.15.1",
"pnpm": "^9.0.0"
},
"engines-next": {
"description": "Versions other than the below are deprecated and a warning will be logged",
"node": "^18.12.0 || >=20.0.0"
},
"dependencies": {
"@aws-sdk/client-codecommit": "3.606.0",
"@aws-sdk/client-ec2": "3.606.0",
Expand Down

0 comments on commit 82b75c6

Please sign in to comment.