semantic-release 20.0.0-beta.3 → 20.0.0
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 +4 -5
- package/bin/semantic-release.js +9 -9
- package/cli.js +31 -31
- package/docs/developer-guide/js-api.md +46 -37
- package/docs/developer-guide/plugin.md +97 -93
- package/docs/extending/plugins-list.md +8 -7
- package/docs/extending/shareable-configurations-list.md +2 -0
- package/docs/recipes/ci-configurations/README.md +1 -0
- package/docs/recipes/ci-configurations/github-actions.md +6 -3
- package/docs/recipes/ci-configurations/gitlab-ci.md +2 -3
- package/docs/recipes/git-hosted-services/README.md +1 -0
- package/docs/recipes/git-hosted-services/git-auth-ssh-keys.md +4 -1
- package/docs/recipes/release-workflow/README.md +1 -0
- package/docs/recipes/release-workflow/distribution-channels.md +1 -0
- package/docs/recipes/release-workflow/maintenance-releases.md +1 -0
- package/docs/recipes/release-workflow/pre-releases.md +1 -0
- package/docs/support/FAQ.md +25 -14
- package/docs/support/node-version.md +1 -1
- package/docs/support/troubleshooting.md +1 -0
- package/docs/usage/ci-configuration.md +4 -3
- package/docs/usage/configuration.md +8 -2
- package/docs/usage/plugins.md +11 -5
- package/docs/usage/workflow-configuration.md +29 -17
- package/index.js +75 -72
- package/lib/get-commits.js +15 -9
- package/lib/get-config.js +38 -38
- package/lib/get-error.js +4 -4
- package/lib/get-git-auth-url.js +32 -32
- package/lib/get-last-release.js +8 -8
- package/lib/get-logger.js +10 -10
- package/lib/get-next-version.js +11 -11
- package/lib/get-release-to-add.js +17 -17
- package/lib/git.js +41 -41
- package/lib/hide-sensitive.js +6 -6
- package/lib/utils.js +12 -12
- package/lib/verify.js +14 -14
- package/package.json +6 -16
package/lib/verify.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import {isPlainObject, isString, template} from
|
|
2
|
-
import AggregateError from
|
|
3
|
-
import {isGitRepo, verifyTagName} from
|
|
4
|
-
import getError from
|
|
1
|
+
import { isPlainObject, isString, template } from "lodash-es";
|
|
2
|
+
import AggregateError from "aggregate-error";
|
|
3
|
+
import { isGitRepo, verifyTagName } from "./git.js";
|
|
4
|
+
import getError from "./get-error.js";
|
|
5
5
|
|
|
6
6
|
export default async (context) => {
|
|
7
7
|
const {
|
|
8
8
|
cwd,
|
|
9
9
|
env,
|
|
10
|
-
options: {repositoryUrl, tagFormat, branches},
|
|
10
|
+
options: { repositoryUrl, tagFormat, branches },
|
|
11
11
|
} = context;
|
|
12
12
|
const errors = [];
|
|
13
13
|
|
|
14
|
-
if (!(await isGitRepo({cwd, env}))) {
|
|
15
|
-
errors.push(getError(
|
|
14
|
+
if (!(await isGitRepo({ cwd, env }))) {
|
|
15
|
+
errors.push(getError("ENOGITREPO", { cwd }));
|
|
16
16
|
} else if (!repositoryUrl) {
|
|
17
|
-
errors.push(getError(
|
|
17
|
+
errors.push(getError("ENOREPOURL"));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// Verify that compiling the `tagFormat` produce a valid Git tag
|
|
21
|
-
if (!(await verifyTagName(template(tagFormat)({version:
|
|
22
|
-
errors.push(getError(
|
|
21
|
+
if (!(await verifyTagName(template(tagFormat)({ version: "0.0.0" })))) {
|
|
22
|
+
errors.push(getError("EINVALIDTAGFORMAT", context));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// Verify the `tagFormat` contains the variable `version` by compiling the `tagFormat` template
|
|
26
26
|
// with a space as the `version` value and verify the result contains the space.
|
|
27
27
|
// The space is used as it's an invalid tag character, so it's guaranteed to no be present in the `tagFormat`.
|
|
28
|
-
if ((template(tagFormat)({version:
|
|
29
|
-
errors.push(getError(
|
|
28
|
+
if ((template(tagFormat)({ version: " " }).match(/ /g) || []).length !== 1) {
|
|
29
|
+
errors.push(getError("ETAGNOVERSION", context));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
branches.forEach((branch) => {
|
|
33
33
|
if (
|
|
34
34
|
!((isString(branch) && branch.trim()) || (isPlainObject(branch) && isString(branch.name) && branch.name.trim()))
|
|
35
35
|
) {
|
|
36
|
-
errors.push(getError(
|
|
36
|
+
errors.push(getError("EINVALIDBRANCH", { branch }));
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
if (errors.length > 0) {
|
|
41
41
|
throw new AggregateError(errors);
|
|
42
42
|
}
|
|
43
|
-
}
|
|
43
|
+
};
|
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": "20.0.0
|
|
4
|
+
"version": "20.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
|
|
7
7
|
"ava": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"aggregate-error": "^4.0.1",
|
|
35
35
|
"cosmiconfig": "^7.0.0",
|
|
36
36
|
"debug": "^4.0.0",
|
|
37
|
-
"env-ci": "8.0.0
|
|
37
|
+
"env-ci": "^8.0.0",
|
|
38
38
|
"execa": "^6.1.0",
|
|
39
39
|
"figures": "^5.0.0",
|
|
40
40
|
"find-versions": "^5.1.0",
|
|
@@ -69,14 +69,11 @@
|
|
|
69
69
|
"mockserver-client": "5.14.0",
|
|
70
70
|
"nock": "13.2.9",
|
|
71
71
|
"p-retry": "^5.1.1",
|
|
72
|
+
"prettier": "^2.7.1",
|
|
72
73
|
"sinon": "14.0.0",
|
|
73
74
|
"stream-buffers": "3.0.2",
|
|
74
75
|
"tempy": "^3.0.0",
|
|
75
|
-
"testdouble": "3.16.6"
|
|
76
|
-
"xo": "0.32.1"
|
|
77
|
-
},
|
|
78
|
-
"overrides": {
|
|
79
|
-
"semantic-release": "20.0.0-beta.1"
|
|
76
|
+
"testdouble": "3.16.6"
|
|
80
77
|
},
|
|
81
78
|
"engines": {
|
|
82
79
|
"node": ">=18"
|
|
@@ -128,20 +125,13 @@
|
|
|
128
125
|
},
|
|
129
126
|
"scripts": {
|
|
130
127
|
"codecov": "codecov -f coverage/coverage-final.json",
|
|
131
|
-
"lint": "
|
|
128
|
+
"lint": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"docs/**/*.md\" \"{bin,lib,test}/*.js\"",
|
|
129
|
+
"lint:fix": "prettier --write \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"docs/**/*.md\" \"{bin,lib,test}/*.js\"",
|
|
132
130
|
"pretest": "npm run lint",
|
|
133
131
|
"semantic-release": "./bin/semantic-release.js",
|
|
134
132
|
"test": "c8 ava --verbose",
|
|
135
133
|
"test:ci": "c8 ava --verbose"
|
|
136
134
|
},
|
|
137
|
-
"xo": {
|
|
138
|
-
"prettier": true,
|
|
139
|
-
"space": true,
|
|
140
|
-
"rules": {
|
|
141
|
-
"unicorn/no-reduce": "off",
|
|
142
|
-
"unicorn/string-content": "off"
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
135
|
"renovate": {
|
|
146
136
|
"extends": [
|
|
147
137
|
"github>semantic-release/.github"
|