Skip to content

Commit cf97c59

Browse files
committed
chore: bump minimum Node version to 20.8.1
This bumps the minimum supported Node version to 20.8.1. Node 20 is the new LTS version and some of our dependencies already dropped supported for Node 18. Check out [our Node Support Policy](https://semantic-release.gitbook.io/semantic-release/support/node-support-policy) to understand how we handle Node versions. BREAKING CHANGE: Node 18 and 19 are not supported anymore. Users have to upgrade to Node 20.8.1 or later.
1 parent c097f05 commit cf97c59

File tree

4 files changed

+28
-71
lines changed

4 files changed

+28
-71
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ jobs:
1313
strategy:
1414
matrix:
1515
node-version:
16-
- 18.0.0
17-
- 19
16+
- 20.8.1 # minimum supported Node version
17+
- 20
18+
- 21
1819
os:
1920
- ubuntu-latest
2021
- macos-latest

lib/publish.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { createReadStream, readFileSync } from "fs";
1+
import { readFileSync } from "fs";
22
import pathlib from "path";
33
import fs from "fs-extra";
44
import { isPlainObject, template } from "lodash-es";
5-
import FormData from "form-data";
5+
import { FormData } from "formdata-node";
6+
import { fileFromPath } from "formdata-node/file-from-path";
67
import urlJoin from "url-join";
78
import got from "got";
89
import _debug from "debug";
@@ -123,7 +124,7 @@ export default async (pluginConfig, context) => {
123124

124125
try {
125126
const form = new FormData();
126-
form.append("file", createReadStream(file));
127+
form.append("file", await fileFromPath(file));
127128
response = await got.post(uploadEndpoint, { ...apiOptions, ...proxy, body: form }).json();
128129
} catch (error) {
129130
logger.error("An error occurred while uploading %s to the GitLab project uploads API:\n%O", file, error);

package-lock.json

Lines changed: 19 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"debug": "^4.0.0",
2323
"dir-glob": "^3.0.0",
2424
"escape-string-regexp": "^5.0.0",
25-
"form-data": "^4.0.0",
25+
"formdata-node": "^6.0.3",
2626
"fs-extra": "^11.0.0",
2727
"globby": "^14.0.0",
2828
"got": "^13.0.0",
@@ -41,7 +41,7 @@
4141
"tempy": "1.0.1"
4242
},
4343
"engines": {
44-
"node": ">=18"
44+
"node": ">=20.8.1"
4545
},
4646
"files": [
4747
"lib",

0 commit comments

Comments
 (0)