semantic-release 25.0.2 → 25.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -139,7 +139,6 @@ In order to use **semantic-release** you need:
139
139
 
140
140
  - [GitHub Discussions](https://github.com/semantic-release/semantic-release/discussions)
141
141
  - [Stack Overflow](https://stackoverflow.com/questions/tagged/semantic-release)
142
- - [Twitter](https://twitter.com/SemanticRelease)
143
142
 
144
143
  ## Badge
145
144
 
@@ -21,6 +21,27 @@ This is because npm's Trusted Publisher mechanism authorizes the workflow that i
21
21
  Before trusted publishing was available, generating provenance attestations required configuring your project to enable publishing with provenance.
22
22
  With trusted publishing, npm provenance is automatically generated for packages published to npm from GitHub Actions without any additional configuration.
23
23
 
24
+ ## Important: Avoid `registry-url` in `setup-node`
25
+
26
+ **Do not** set the `registry-url` option in the `actions/setup-node` step when using semantic-release for npm publishing. The `registry-url` option causes `setup-node` to create an `.npmrc` file that can conflict with semantic-release's npm authentication mechanism, leading to `EINVALIDNPMTOKEN` errors even when your token is valid.
27
+
28
+ ```yaml
29
+ # ❌ Don't do this - can cause conflicts with semantic-release
30
+ - name: Setup Node.js
31
+ uses: actions/setup-node@v4
32
+ with:
33
+ node-version: "lts/*"
34
+ registry-url: "https://registry.npmjs.org"
35
+
36
+ # ✅ Do this instead - let semantic-release handle npm authentication
37
+ - name: Setup Node.js
38
+ uses: actions/setup-node@v4
39
+ with:
40
+ node-version: "lts/*"
41
+ ```
42
+
43
+ If you need to specify a custom registry, configure it in your project's `.npmrc` file instead. This ensures consistent behavior between local development and CI environments, and avoids conflicts with semantic-release.
44
+
24
45
  ## Node project configuration
25
46
 
26
47
  [GitHub Actions](https://github.com/features/actions) support [Workflows](https://help.github.com/en/articles/configuring-workflows), allowing to run tests on multiple Node versions and publish a release only when all test pass.
@@ -1,5 +1,4 @@
1
1
  import { isNil, sortBy } from "lodash-es";
2
- import semverDiff from "semver-diff";
3
2
  import { FIRST_RELEASE, RELEASE_TYPE } from "../definitions/constants.js";
4
3
  import {
5
4
  getFirstVersion,
@@ -7,6 +6,7 @@ import {
7
6
  getLowerBound,
8
7
  getRange,
9
8
  getUpperBound,
9
+ getVersionDiff,
10
10
  highest,
11
11
  isMajorRange,
12
12
  lowest,
@@ -42,7 +42,7 @@ export function maintenance({ maintenance, release }) {
42
42
  FIRST_RELEASE;
43
43
  // The upper bound is the lowest version between the `base` version and the upper bound of the current branch range
44
44
  const max = lowest(base, getUpperBound(range));
45
- const diff = semverDiff(min, max);
45
+ const diff = getVersionDiff(min, max);
46
46
  return {
47
47
  ...rest,
48
48
  type: "maintenance",
@@ -75,7 +75,7 @@ export function release({ release }) {
75
75
  ? undefined
76
76
  : getFirstVersion(tagsToVersions(release[idx + 1].tags), release.slice(0, idx + 1));
77
77
 
78
- const diff = bound ? semverDiff(lastVersion, bound) : null;
78
+ const diff = bound ? getVersionDiff(lastVersion, bound) : null;
79
79
  return {
80
80
  ...rest,
81
81
  channel: idx === 0 ? channel : isNil(channel) ? name : channel,
@@ -1,8 +1,7 @@
1
1
  import { intersection, uniqBy } from "lodash-es";
2
2
  import semver from "semver";
3
- import semverDiff from "semver-diff";
4
3
  import getLastRelease from "./get-last-release.js";
5
- import { getLowerBound, makeTag } from "./utils.js";
4
+ import { getLowerBound, getVersionDiff, makeTag } from "./utils.js";
6
5
 
7
6
  /**
8
7
  * Find releases that have been merged from a higher branch but not added on the channel of the current branch.
@@ -42,7 +41,7 @@ export default (context) => {
42
41
  return;
43
42
  }
44
43
 
45
- const type = lastRelease.version ? semverDiff(lastRelease.version, version) : "major";
44
+ const type = lastRelease.version ? getVersionDiff(lastRelease.version, version) : "major";
46
45
  const name = makeTag(tagFormat, version);
47
46
  return {
48
47
  lastRelease,
package/lib/utils.js CHANGED
@@ -82,6 +82,14 @@ export function isSameChannel(channel, otherChannel) {
82
82
  return channel === otherChannel || (!channel && !otherChannel);
83
83
  }
84
84
 
85
+ export function getVersionDiff(version1, version2) {
86
+ if (semver.gte(version1, version2)) {
87
+ return undefined;
88
+ }
89
+
90
+ return semver.diff(version1, version2);
91
+ }
92
+
85
93
  export function extractGitLogTags(tagsString) {
86
94
  const regex = /tag: ([^,)]+)/g;
87
95
  let match;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "semantic-release",
3
3
  "description": "Automated semver compliant package publishing",
4
- "version": "25.0.2",
4
+ "version": "25.0.3",
5
5
  "type": "module",
6
6
  "author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
7
7
  "ava": {
@@ -53,12 +53,11 @@
53
53
  "read-package-up": "^12.0.0",
54
54
  "resolve-from": "^5.0.0",
55
55
  "semver": "^7.3.2",
56
- "semver-diff": "^5.0.0",
57
56
  "signale": "^1.2.1",
58
57
  "yargs": "^18.0.0"
59
58
  },
60
59
  "devDependencies": {
61
- "@types/node": "24.10.0",
60
+ "@types/node": "24.10.9",
62
61
  "@types/signale": "1.4.7",
63
62
  "ava": "6.4.1",
64
63
  "c8": "10.1.3",
@@ -66,20 +65,20 @@
66
65
  "cz-conventional-changelog": "3.3.0",
67
66
  "dockerode": "4.0.9",
68
67
  "file-url": "4.0.0",
69
- "fs-extra": "11.3.2",
70
- "got": "14.6.2",
71
- "js-yaml": "4.1.0",
72
- "lockfile-lint": "4.14.1",
73
- "ls-engines": "0.9.3",
68
+ "fs-extra": "11.3.3",
69
+ "got": "14.6.6",
70
+ "js-yaml": "4.1.1",
71
+ "lockfile-lint": "5.0.0",
72
+ "ls-engines": "0.10.0",
74
73
  "mockserver-client": "5.15.0",
75
74
  "nock": "14.0.10",
76
75
  "npm-run-all2": "8.0.4",
77
- "p-retry": "7.1.0",
78
- "prettier": "3.6.2",
79
- "publint": "0.3.15",
80
- "sinon": "21.0.0",
76
+ "p-retry": "7.1.1",
77
+ "prettier": "3.8.1",
78
+ "publint": "0.3.17",
79
+ "sinon": "21.0.1",
81
80
  "stream-buffers": "3.0.3",
82
- "tempy": "3.1.0",
81
+ "tempy": "3.1.2",
83
82
  "testdouble": "3.20.2"
84
83
  },
85
84
  "engines": {
@@ -163,5 +162,5 @@
163
162
  "github>semantic-release/.github:renovate-config"
164
163
  ]
165
164
  },
166
- "packageManager": "npm@11.4.2"
165
+ "packageManager": "npm@11.8.0+sha512.9f5f6c25e5be44629d907a3c482739c614b090a8505057d9685cd273e12c6172e34aa215d2d97bd9a0d8415bb356f7eb6f2b06c1d690b0d2cdcb9f09d7410149"
167
166
  }