You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -124,7 +126,7 @@ npm-publish exposes several output variables, which you can use in later steps o
124
126
125
127
```diff
126
128
steps:
127
-
- uses: JS-DevTools/npm-publish@v3
129
+
- uses: JS-DevTools/npm-publish@v4
128
130
+ id: publish
129
131
with:
130
132
token: ${{ secrets.NPM_TOKEN }}
@@ -285,17 +287,29 @@ Examples:
285
287
Major releases of the action and libraries may contain breaking changes, documented here.
286
288
For more detailed change logs, see [releases][].
287
289
288
-
### v2 to v3
290
+
### v3 to v4
289
291
290
-
The v3 release does not require any changes to how you use `npm-publish` from `v2`. The version of Node.js used by the action was updated to v20 due to GitHub Action's [deprecation of Node.js v16][node16-deprecation]. The minimum required version of Node.js for the library and CLI remains v16.
292
+
The `v4` release does not require any changes to how you use the `npm-publish` action from `v3`. The action was updated to Node 24 / npm 11.
293
+
294
+
In the library and CLI, support for Node 16 and Node 18 was dropped in `v4`, and the library API was switched to ESM-only. Library users should switch to ESM or update Node to a version with support for [loading ES modules using `require`][esm-require].
The `v4` release does not require any changes to how you use the `npm-publish` action from `v2`. The action was updated to Node 20 in `v3` due to GitHub Action's [deprecation of Node 16][node16-deprecation], and then updated to Node 24 in `v4`.
301
+
302
+
In the library and CLI, support for Node 16 and Node 18 was dropped in `v4`, and the library API was switched to ESM-only. Library users should switch to ESM or update Node to a version with support for [loading ES modules using `require`][esm-require].
The v2 release made several breaking changes to inputs, outputs, and behaviors that were present in `v1`. The examples below focus on the action, but the same changes are applicable to the library and CLI, too.
297
309
298
-
#### v2 option changes
310
+
In the library and CLI, support for Node 16 and Node 18 was dropped in `v4`, and the library API was switched to ESM-only. Library users should switch to ESM or update Node to a version with support for [loading ES modules using `require`][esm-require].
311
+
312
+
#### option changes
299
313
300
314
The `check-version` and `greater-version-only` boolean options were replaced with the `strategy` option:
301
315
@@ -319,9 +333,9 @@ The `check-version` and `greater-version-only` boolean options were replaced wit
319
333
`check-version: false` has been removed. If you only need to publish, without first checking whether the version exists in the registry, you can [use `npm` directly][publishing-nodejs-packages] instead:
320
334
321
335
```diff
322
-
- uses: actions/setup-node@v3
336
+
- uses: actions/setup-node@v5
323
337
with:
324
-
node-version: '18'
338
+
node-version: '24'
325
339
+ registry-url: https://registry.npmjs.org/
326
340
327
341
- - uses: JS-DevTools/npm-publish@v1
@@ -335,7 +349,7 @@ The `check-version` and `greater-version-only` boolean options were replaced wit
The `type` output is now an empty string instead of `'none'` when no release occurs
341
355
@@ -345,15 +359,15 @@ The `type` output is now an empty string instead of `'none'` when no release occ
345
359
+ if: ${{ steps.publish.outputs.type }}
346
360
```
347
361
348
-
#### v2 behavior changes
362
+
#### behavior changes
349
363
350
364
The `--ignore-scripts` option is now passed to `npm publish` as a security precaution. If you define any publish lifecycle scripts - `prepublishOnly`, `prepack`, `prepare`, `postpack`, `publish`, `postpublish` - we recommend you run that logic as a separate explicit build step.
351
365
352
366
```diff
353
367
+ - run: npm run build
354
368
355
369
- - uses: JS-DevTools/npm-publish@v1
356
-
+ - uses: JS-DevTools/npm-publish@v3
370
+
+ - uses: JS-DevTools/npm-publish@v4
357
371
with:
358
372
token: ${{ secrets.NPM_TOKEN }}
359
373
```
@@ -362,7 +376,7 @@ If you can't change your build, you can set the `ignore-scripts` input to `false
362
376
363
377
```diff
364
378
- - uses: JS-DevTools/npm-publish@v1
365
-
+ - uses: JS-DevTools/npm-publish@v3
379
+
+ - uses: JS-DevTools/npm-publish@v4
366
380
with:
367
381
token: ${{ secrets.NPM_TOKEN }}
368
382
+ ignore-scripts: false
@@ -371,13 +385,13 @@ If you can't change your build, you can set the `ignore-scripts` input to `false
371
385
The global `.npmrc` file is no longer read nor modified. This means the `token` option is now required for the library and CLI. (It was already required for the action.) You may have workarounds in place referencing `INPUT_TOKEN`, which v1 [erroneously wrote][#15] to `.npmrc`. These workarounds should be removed.
0 commit comments