semantic-release 25.0.1 → 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
 
@@ -213,3 +213,15 @@
213
213
  - [sr-uv-plugin](https://github.com/Artessan-Devs/sr-uv-plugin)
214
214
  - `verifyConditions`: Ensures `pyproject.toml` exists and contains a `[project]` section.
215
215
  - `prepare`: Updates the `[project].version` field in `pyproject.toml` to match the release version.
216
+ - [semantic-release-uv](https://github.com/Deltamir/semantic-release-uv)
217
+ - `verifyConditions`: Verify the presence and validity of a `PYPI_TOKEN` and validate the `pyproject.toml` structure
218
+ - `prepare`: Update the version in `pyproject.toml`, locking and build the distribution with `uv`
219
+ - `publish`: Publish the package to PyPI or a custom index using `uv publish`
220
+ - [@jno21/semantic-release-github-commit](https://github.com/Jno21/semantic-release-github-commit)
221
+ - **Notes**: This plugin creates a commit on GitHub using the GitHub API, enabling signed commits via a GitHub App.
222
+ - `verifyConditions`: Verify GitHub authentication and configuration.
223
+ - `prepare`: Create a commit with the specified files using the GitHub API.
224
+ - [semantic-release-minecraft](https://github.com/pynickle/semantic-release)
225
+ - `verifyConditions`: Verify that all needed configuration is present.
226
+ - `prepare`: Convert different types of CurseForge game versions to their corresponding IDs.
227
+ - `publish`: Publish the Minecraft project to CurseForge and Modrinth.
@@ -13,10 +13,35 @@ GitHub Actions is a [trusted identity provider](https://docs.npmjs.com/trusted-p
13
13
  The npm registry [recently increased restrictions for use of long-lived access tokens](https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/), further encouraging trusted publishing as the preferred approach for publishing to npm from GitHub Actions.
14
14
  Enabling trusted publishing requires granting the `id-token: write` permission to the job performing the publish step and [configuring a trust relationship](https://docs.npmjs.com/trusted-publishers#step-1-add-a-trusted-publisher-on-npmjscom) between your GitHub repository and npm.
15
15
 
16
+ **Note**: When setting up a Trusted Publisher on npmjs for GitHub Actions, it's crucial to specify the workflow file that triggers the release process, not necessarily the one that contains the release logic itself.
17
+ If your release job is encapsulated in a [reusable workflow](https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows), the workflow file you must reference is the caller workflow—typically the one triggered by events like `push` or `workflow_dispatch` on your main branch.
18
+ This is because npm's Trusted Publisher mechanism authorizes the workflow that initiates the run, not any downstream workflows it invokes.
19
+
16
20
  [npm provenance](https://docs.npmjs.com/generating-provenance-statements) is valuable for increasing supply-chain security for your npm packages.
17
21
  Before trusted publishing was available, generating provenance attestations required configuring your project to enable publishing with provenance.
18
22
  With trusted publishing, npm provenance is automatically generated for packages published to npm from GitHub Actions without any additional configuration.
19
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
+
20
45
  ## Node project configuration
21
46
 
22
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,6 +1,6 @@
1
1
  # Node version requirement
2
2
 
3
- **semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 20.8.1 or higher**.
3
+ **semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 22.14.0 or higher**.
4
4
 
5
5
  **semantic-release** is meant to be used in a CI environment as a development support tool, not as a production dependency.
6
6
  Therefore, the only constraint is to run the `semantic-release` in a CI environment providing version of Node that meets our version requirement.
@@ -24,7 +24,7 @@ See [CI configuration](../usage/ci-configuration.md) and [CI configuration recip
24
24
  Use it to execute the `semantic-release` command.
25
25
 
26
26
  ```bash
27
- $ npx -p node@v18-lts -c "npx semantic-release"
27
+ $ npx -p node@v24 -c "npx semantic-release"
28
28
  ```
29
29
 
30
30
  **Note**: See [What is npx](./FAQ.md#what-is-npx) for more details.
@@ -1,44 +1,35 @@
1
1
  # Installation
2
2
 
3
- ## Local installation
4
-
5
- For [Node modules projects](https://docs.npmjs.com/getting-started/creating-node-modules) we recommend installing **semantic-release** locally and running the `semantic-release` command with [npx](https://www.npmjs.com/package/npx):
6
-
7
- ```bash
8
- npm install --save-dev semantic-release
9
- ```
3
+ ## Global installation
10
4
 
11
- Then in the CI environment:
5
+ We recommend installing **semantic-release** directly in the CI environment as part of executing with [npx](../support/FAQ.md#what-is-npx):
12
6
 
13
- ```bash
7
+ ```sh
14
8
  npx semantic-release
15
9
  ```
16
10
 
17
- **Note:** `npx` is a tool bundled with `npm@>=5.2.0`. It is used to conveniently find the semantic-release binary and to execute it. See [What is npx](../support/FAQ.md#what-is-npx) for more details.
18
-
19
- ## Global installation
11
+ If you need to leverage plugins and/or presets that are not included in the base **semantic-release** package, you can install them part of executing with `npx` as well:
20
12
 
21
- For other type of projects we recommend installing **semantic-release** directly in the CI environment, also with [npx](https://www.npmjs.com/package/npx):
22
-
23
- ```bash
24
- npx semantic-release
13
+ ```sh
14
+ npx --package semantic-release --package @semantic-release/exec --package conventional-changelog-conventionalcommits semantic-release
25
15
  ```
26
16
 
27
17
  ### Notes
28
18
 
29
- 1. If you've globally installed **semantic-release** then we recommend that you set the major **semantic-release** version to install.
30
- For example, by using `npx semantic-release@18`.
31
- This way you control which major version of **semantic-release** is used by your build, and thus avoid breaking the build when there's a new major version of **semantic-release**.
19
+ 1. When globally installing **semantic-release** as part of running with `npx`, we recommend setting at least the major **semantic-release** version to install.
20
+ For example, by using `npx semantic-release@25`.
21
+ This way you control which major version of **semantic-release** is used by your pipeline, and thus avoid breaking the release when there's a new major version of **semantic-release**.
32
22
  2. Pinning **semantic-release** to an exact version makes your releases even more deterministic.
33
23
  But pinning also means you, or a bot, must upgrade **semantic-release** when a new version is released.
34
24
  3. You can use [Renovate's regex manager](https://docs.renovatebot.com/modules/manager/regex/) to get automatic updates for **semantic-release** in either of the above scenarios.
35
25
  Put this in your Renovate configuration file:
36
26
  ```json
37
27
  {
38
- "regexManagers": [
28
+ "customManagers": [
39
29
  {
30
+ "customType": "regex",
40
31
  "description": "Update semantic-release version used by npx",
41
- "fileMatch": ["^\\.github/workflows/[^/]+\\.ya?ml$"],
32
+ "managerFilePatterns": ["^\\.github/workflows/[^/]+\\.ya?ml$"],
42
33
  "matchStrings": ["\\srun: npx semantic-release@(?<currentValue>.*?)\\s"],
43
34
  "datasourceTemplate": "npm",
44
35
  "depNameTemplate": "semantic-release"
@@ -48,3 +39,13 @@ npx semantic-release
48
39
  ```
49
40
  4. `npx` is a tool bundled with `npm@>=5.2.0`. You can use it to install (and run) the **semantic-release** binary.
50
41
  See [What is npx](../support/FAQ.md#what-is-npx) for more details.
42
+
43
+ ## Local installation
44
+
45
+ Since **semantic-release** isn't truly a development dependency, but rather a release dependency, we recommend avoiding installation as a local dependency of your project.
46
+ Instead, we recommend installing it globally in your CI environment as part of executing with [npx](../support/FAQ.md#what-is-npx) as described [above](#global-insallation).
47
+ Installing only during the release process avoids:
48
+
49
+ - installing unnecessary dependencies during development and testing, including the fairly sizable dependency on **npm**
50
+ - installing a different version of **npm** into `node_modules/` than the one used to run the release, which can lead to conflicts and unexpected behavior
51
+ - installing dependencies that could conflict with other development dependencies, like **commitlint**
@@ -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.1",
4
+ "version": "25.0.3",
5
5
  "type": "module",
6
6
  "author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
7
7
  "ava": {
@@ -50,15 +50,14 @@
50
50
  "micromatch": "^4.0.2",
51
51
  "p-each-series": "^3.0.0",
52
52
  "p-reduce": "^3.0.0",
53
- "read-package-up": "^11.0.0",
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": "22.18.11",
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.0",
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.14",
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
  }