semantic-release 25.0.0-beta.1 → 25.0.0-beta.11
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/docs/extending/plugins-list.md +9 -0
- package/lib/branches/get-tags.js +6 -2
- package/lib/git.js +49 -28
- package/lib/utils.js +11 -1
- package/package.json +18 -18
|
@@ -66,6 +66,9 @@
|
|
|
66
66
|
- `publish`: Publish the package to the Visual Studio Code marketplace
|
|
67
67
|
- [semantic-release-verify-deps](https://github.com/piercus/semantic-release-verify-deps)
|
|
68
68
|
- `verifyConditions`: Check the dependencies format against a regexp before a release
|
|
69
|
+
- [semantic-release-openapi](https://github.com/aensley/semantic-release-openapi)
|
|
70
|
+
- `verifyConditions`: Verify `apiSpecFiles` is specified with at least one file name and all matching files have a .json, .yaml, or .yml extension.
|
|
71
|
+
- `prepare`: Write the correct version to all OpenAPI / Swagger files specified in `apiSpecFiles`.
|
|
69
72
|
- [semantic-release-chrome](https://github.com/GabrielDuarteM/semantic-release-chrome)
|
|
70
73
|
- `verifyConditions`: Verify the presence of the authentication (set via environment variables)
|
|
71
74
|
- `prepare`: Write the correct version to the `manifest.json` and creates a zip file of the whole dist folder
|
|
@@ -204,3 +207,9 @@
|
|
|
204
207
|
- [semantic-release-kaniko](https://github.com/brendangeck/semantic-release-kaniko)
|
|
205
208
|
- `verifyConditions`: Verify that all needed configuration is present and login to the Docker registry.
|
|
206
209
|
- `publish`: Build a container image using [Kaniko](https://github.com/GoogleContainerTools/kaniko) and (optionally) push it to a Docker registry.
|
|
210
|
+
- [semantic-release-skopeo](https://github.com/LukasWestholt/semantic-release-skopeo)
|
|
211
|
+
- `verifyConditions`: Verify that all needed configuration is present and check if destination is writeable (unless force=true).
|
|
212
|
+
- `publish`: Copy OCI images to a custom (Docker) registry using daemonless open-source tool [skopeo](https://github.com/containers/skopeo/).
|
|
213
|
+
- [sr-uv-plugin](https://github.com/Artessan-Devs/sr-uv-plugin)
|
|
214
|
+
- `verifyConditions`: Ensures `pyproject.toml` exists and contains a `[project]` section.
|
|
215
|
+
- `prepare`: Updates the `[project].version` field in `pyproject.toml` to match the release version.
|
package/lib/branches/get-tags.js
CHANGED
|
@@ -2,7 +2,7 @@ import { escapeRegExp, template } from "lodash-es";
|
|
|
2
2
|
import semver from "semver";
|
|
3
3
|
import pReduce from "p-reduce";
|
|
4
4
|
import debugTags from "debug";
|
|
5
|
-
import {
|
|
5
|
+
import { getTags, getTagsNotes } from "../../lib/git.js";
|
|
6
6
|
|
|
7
7
|
const debug = debugTags("semantic-release:get-tags");
|
|
8
8
|
|
|
@@ -13,6 +13,9 @@ export default async ({ cwd, env, options: { tagFormat } }, branches) => {
|
|
|
13
13
|
// so it's guaranteed to no be present in the `tagFormat`.
|
|
14
14
|
const tagRegexp = `^${escapeRegExp(template(tagFormat)({ version: " " })).replace(" ", "(.+)")}`;
|
|
15
15
|
|
|
16
|
+
// Get the tags notes for all the tags in the repository
|
|
17
|
+
const tagsNotesMap = await getTagsNotes({ cwd, env });
|
|
18
|
+
|
|
16
19
|
return pReduce(
|
|
17
20
|
branches,
|
|
18
21
|
async (branches, branch) => {
|
|
@@ -20,8 +23,9 @@ export default async ({ cwd, env, options: { tagFormat } }, branches) => {
|
|
|
20
23
|
await getTags(branch.name, { cwd, env }),
|
|
21
24
|
async (branchTags, tag) => {
|
|
22
25
|
const [, version] = tag.match(tagRegexp) || [];
|
|
26
|
+
const channels = tagsNotesMap.has(tag) ? tagsNotesMap.get(tag).channels : [null];
|
|
23
27
|
return version && semver.valid(semver.clean(version))
|
|
24
|
-
? [...branchTags, { gitTag: tag, version, channels
|
|
28
|
+
? [...branchTags, { gitTag: tag, version, channels }]
|
|
25
29
|
: branchTags;
|
|
26
30
|
},
|
|
27
31
|
[]
|
package/lib/git.js
CHANGED
|
@@ -4,6 +4,7 @@ import { execa } from "execa";
|
|
|
4
4
|
import debugGit from "debug";
|
|
5
5
|
import { merge } from "lodash-es";
|
|
6
6
|
import { GIT_NOTE_REF } from "./definitions/constants.js";
|
|
7
|
+
import { extractGitLogTags } from "./utils.js";
|
|
7
8
|
|
|
8
9
|
const debug = debugGit("semantic-release:git");
|
|
9
10
|
|
|
@@ -296,42 +297,62 @@ export async function isBranchUpToDate(repositoryUrl, branch, execaOptions) {
|
|
|
296
297
|
}
|
|
297
298
|
|
|
298
299
|
/**
|
|
299
|
-
*
|
|
300
|
+
* Retrieves a map of Git tags to their associated notes from the repository.
|
|
300
301
|
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
302
|
+
* Executes a `git log` command to list tags and their notes, then parses the output into a Map
|
|
303
|
+
* where each key is a tag name (e.g., "v24.2.3") and the value is the parsed JSON note object.
|
|
303
304
|
*
|
|
304
|
-
* @
|
|
305
|
+
* @async
|
|
306
|
+
* @param {import('execa').Options} execaOptions - Options to pass to `execa`
|
|
307
|
+
* @returns {Promise<Map<string, Object>>} A promise that resolves to a Map of tag names to their notes.
|
|
305
308
|
*/
|
|
306
|
-
export async function
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
export async function getTagsNotes(execaOptions) {
|
|
310
|
+
/**
|
|
311
|
+
* git log --tags="*" --decorate-refs="refs/tags/*" --no-walk --format="%d%x09%N" --notes="refs/notes/semantic-release*"
|
|
312
|
+
*
|
|
313
|
+
* (tag: v1.2.3)
|
|
314
|
+
* (tag: v2.0.0) {"channels":[null]}
|
|
315
|
+
* (tag: v3.0.0, tag: 5833/merge) {"channels":[null]}
|
|
316
|
+
* ...
|
|
317
|
+
*/
|
|
318
|
+
const { stdout } = await execa(
|
|
319
|
+
"git",
|
|
320
|
+
[
|
|
321
|
+
"log",
|
|
322
|
+
"--tags=*",
|
|
323
|
+
"--decorate-refs=refs/tags/*", // This filters the refs shown in the %d format specifier to only include tags matching refs/tags/*.
|
|
324
|
+
"--no-walk", // This ensures that only the commits directly pointed to by the tags are shown, not their historical parents.
|
|
325
|
+
"--format=%d%x09%N", // <refName><tab><notes> eg. (tag: v24.2.3) {"channels":[null]}
|
|
326
|
+
`--notes=refs/notes/${GIT_NOTE_REF}*`, // handles both patterns for notes - `semantic-release` (old) and `semantic-release-<version>` (current)
|
|
327
|
+
],
|
|
328
|
+
execaOptions
|
|
329
|
+
);
|
|
311
330
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
};
|
|
331
|
+
// drop empty lines
|
|
332
|
+
const lines = stdout.split("\n").filter((line) => line.trim() !== "");
|
|
315
333
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
)
|
|
326
|
-
);
|
|
327
|
-
} catch (error) {
|
|
328
|
-
if (error.exitCode === 1) {
|
|
329
|
-
return {};
|
|
334
|
+
// parse and create a map of tags to notes
|
|
335
|
+
const tagNotesMap = new Map();
|
|
336
|
+
|
|
337
|
+
for (const line of lines) {
|
|
338
|
+
const [tagPart, notePart] = line.trim().split("\t"); // tab separator is defined in the git command above (%x09)
|
|
339
|
+
const tags = extractGitLogTags(tagPart);
|
|
340
|
+
if (tags.length === 0) {
|
|
341
|
+
debug(`Cannot parse tags from line: ${line}`);
|
|
342
|
+
continue;
|
|
330
343
|
}
|
|
331
344
|
|
|
332
|
-
|
|
333
|
-
|
|
345
|
+
try {
|
|
346
|
+
const parsed = JSON.parse(notePart);
|
|
347
|
+
tags.forEach((tag) => {
|
|
348
|
+
tagNotesMap.set(tag, parsed);
|
|
349
|
+
});
|
|
350
|
+
} catch (error) {
|
|
351
|
+
debug(error);
|
|
352
|
+
}
|
|
334
353
|
}
|
|
354
|
+
|
|
355
|
+
return tagNotesMap;
|
|
335
356
|
}
|
|
336
357
|
|
|
337
358
|
/**
|
package/lib/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { template, union } from "lodash-es";
|
|
2
2
|
import semver from "semver";
|
|
3
3
|
import hideSensitive from "./hide-sensitive.js";
|
|
4
4
|
|
|
@@ -81,3 +81,13 @@ export function makeTag(tagFormat, version) {
|
|
|
81
81
|
export function isSameChannel(channel, otherChannel) {
|
|
82
82
|
return channel === otherChannel || (!channel && !otherChannel);
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
export function extractGitLogTags(tagsString) {
|
|
86
|
+
const regex = /tag: ([^,)]+)/g;
|
|
87
|
+
let match;
|
|
88
|
+
const tags = [];
|
|
89
|
+
while ((match = regex.exec(tagsString)) !== null) {
|
|
90
|
+
tags.push(match[1]);
|
|
91
|
+
}
|
|
92
|
+
return tags;
|
|
93
|
+
}
|
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.0-beta.
|
|
4
|
+
"version": "25.0.0-beta.11",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
|
|
7
7
|
"ava": {
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"Matt Travi <npm@travi.org> (https://matt.travi.org/)"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@semantic-release/commit-analyzer": "^13.0.
|
|
30
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
31
31
|
"@semantic-release/error": "^4.0.0",
|
|
32
|
-
"@semantic-release/github": "^
|
|
33
|
-
"@semantic-release/npm": "^
|
|
34
|
-
"@semantic-release/release-notes-generator": "^14.
|
|
32
|
+
"@semantic-release/github": "^12.0.0",
|
|
33
|
+
"@semantic-release/npm": "^13.0.0",
|
|
34
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
35
35
|
"aggregate-error": "^5.0.0",
|
|
36
36
|
"cosmiconfig": "^9.0.0",
|
|
37
37
|
"debug": "^4.0.0",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"find-versions": "^6.0.0",
|
|
42
42
|
"get-stream": "^6.0.0",
|
|
43
43
|
"git-log-parser": "^1.2.0",
|
|
44
|
-
"hook-std": "^
|
|
45
|
-
"hosted-git-info": "^
|
|
44
|
+
"hook-std": "^4.0.0",
|
|
45
|
+
"hosted-git-info": "^9.0.0",
|
|
46
46
|
"import-from-esm": "^2.0.0",
|
|
47
47
|
"lodash-es": "^4.17.21",
|
|
48
48
|
"marked": "^15.0.0",
|
|
@@ -53,37 +53,37 @@
|
|
|
53
53
|
"read-package-up": "^11.0.0",
|
|
54
54
|
"resolve-from": "^5.0.0",
|
|
55
55
|
"semver": "^7.3.2",
|
|
56
|
-
"semver-diff": "^
|
|
56
|
+
"semver-diff": "^5.0.0",
|
|
57
57
|
"signale": "^1.2.1",
|
|
58
|
-
"yargs": "^
|
|
58
|
+
"yargs": "^18.0.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/node": "22.
|
|
61
|
+
"@types/node": "22.18.10",
|
|
62
62
|
"@types/signale": "1.4.7",
|
|
63
|
-
"ava": "6.4.
|
|
63
|
+
"ava": "6.4.1",
|
|
64
64
|
"c8": "10.1.3",
|
|
65
65
|
"clear-module": "4.1.2",
|
|
66
66
|
"cz-conventional-changelog": "3.3.0",
|
|
67
|
-
"dockerode": "4.0.
|
|
67
|
+
"dockerode": "4.0.9",
|
|
68
68
|
"file-url": "4.0.0",
|
|
69
|
-
"fs-extra": "11.3.
|
|
70
|
-
"got": "14.
|
|
69
|
+
"fs-extra": "11.3.2",
|
|
70
|
+
"got": "14.5.0",
|
|
71
71
|
"js-yaml": "4.1.0",
|
|
72
72
|
"lockfile-lint": "4.14.1",
|
|
73
73
|
"ls-engines": "0.9.3",
|
|
74
74
|
"mockserver-client": "5.15.0",
|
|
75
|
-
"nock": "14.0.
|
|
75
|
+
"nock": "14.0.10",
|
|
76
76
|
"npm-run-all2": "8.0.4",
|
|
77
|
-
"p-retry": "
|
|
77
|
+
"p-retry": "7.1.0",
|
|
78
78
|
"prettier": "3.6.2",
|
|
79
|
-
"publint": "0.3.
|
|
79
|
+
"publint": "0.3.14",
|
|
80
80
|
"sinon": "21.0.0",
|
|
81
81
|
"stream-buffers": "3.0.3",
|
|
82
82
|
"tempy": "3.1.0",
|
|
83
83
|
"testdouble": "3.20.2"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
|
-
"node": "^22.14.0 || >= 24.
|
|
86
|
+
"node": "^22.14.0 || >= 24.10.0"
|
|
87
87
|
},
|
|
88
88
|
"files": [
|
|
89
89
|
"bin",
|