@semantic-release/exec v2.2.0
@semantic-release/exec
Set of semantic-release plugins to execute custom shell commands.
verifyConditions
Execute a shell command to verify if the release should happen.
Command property | Description |
---|---|
exit code | 0 if the verification is successful, or any other exit code otherwise. |
stdout | Write only the reason for the verification to fail. |
stderr | Can be used for logging. |
analyzeCommits
Execute a shell command to determine the type release.
Command property | Description |
---|---|
exit code | Any non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error. |
stdout | Only the release type (major , minor or patch etc..) can be written to stdout . If no release has to be done the command must not write to stdout . |
stderr | Can be used for logging. |
verifyRelease
Execute a shell command to verifying a release that was determined before and is about to be published.
Command property | Description |
---|---|
exit code | 0 if the verification is successful, or any other exit code otherwise. |
stdout | Only the reason for the verification to fail can be written to stdout . |
stderr | Can be used for logging. |
generateNotes
Execute a shell command to generate the release note.
Command property | Description |
---|---|
exit code | Any non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error. |
stdout | Only the release note must be written to stdout . |
stderr | Can be used for logging. |
prepare
Execute a shell command to prepare the release.
Command property | Description |
---|---|
exit code | Any non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error. |
stdout | Can be used for logging. |
stderr | Can be used for logging. |
publish
Execute a shell command to publish the release.
Command property | Description |
---|---|
exit code | Any non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error. |
stdout | Only the release information must be written to stdout as parseable JSON (for example {"name": "Release name", "url": "http://url/release/1.0.0"} ). |
stderr | Can be used for logging. |
success
Execute a shell command to notify of a successful release.
Command property | Description |
---|---|
exit code | Any non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error. |
stdout | Can be used for logging. |
stderr | Can be used for logging. |
fail
Execute a shell command to notify of a failed release.
Command property | Description |
---|---|
exit code | Any non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error. |
stdout | Can be used for logging. |
stderr | Can be used for logging. |
Configuration
Options
Options | Description |
---|---|
cmd | The shell command to execute. See cmd. |
cmd
The shell command is generated with Lodash template. All the objets passed to the semantic-release plugins are available as template options.
cmd
examples
{
"release": {
"publish": [
{
"path": "@semantic-release/exec",
"cmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}",
},
"@semantic-release/npm",
"@semantic-release/github"
]
}
}
This will execute the shell command ./publish.sh 1.0.0 master 3 870668040000
(for the release of version 1.0.0
from branch master
with 3
commits on August 4th, 1997 at 2:14 AM
).
Usage
Options can be set within the plugin definition in the semantic-release
configuration file:
{
"release": {
"verifyConditions": [
"@semantic-release/npm",
{
"path": "@semantic-release/exec",
"cmd": "./verify.sh",
}
],
"publish": [
"@semantic-release/npm",
{
"path": "@semantic-release/exec",
"cmd": "./publish.sh ${nextRelease.version}",
},
"@semantic-release/github"
]
}
}
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago