6.0.3 • Published 2 years ago

@semantic-release/exec v6.0.3

Weekly downloads
62,441
License
MIT
Repository
github
Last release
2 years ago

@semantic-release/exec

semantic-release plugin to execute custom shell commands.

Build Status npm latest version npm next version npm beta version

StepDescription
verifyConditionsExecute a shell command to verify if the release should happen.
analyzeCommitsExecute a shell command to determine the type of release.
verifyReleaseExecute a shell command to verifying a release that was determined before and is about to be published.
generateNotesExecute a shell command to generate the release note.
prepareExecute a shell command to prepare the release.
publishExecute a shell command to publish the release.
successExecute a shell command to notify of a new release.
failExecute a shell command to notify of a failed release.

Install

$ npm install @semantic-release/exec -D

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/exec", {
      "verifyConditionsCmd": "./verify.sh",
      "publishCmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}"
    }],
  ]
}

With this example:

  • the shell command ./verify.sh will be executed on the verify conditions step
  • 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) will be executed on the publish step

Note: it's required to define a plugin for the analyze commits step. If no analyzeCommitsCmd is defined the plugin @semantic-release/commit-analyzer must be defined in the plugins list.

Configuration

Options

OptionsDescription
verifyConditionsCmdThe shell command to execute during the verify condition step. See verifyConditionsCmd.
analyzeCommitsCmdThe shell command to execute during the analyze commits step. See analyzeCommitsCmd.
verifyReleaseCmdThe shell command to execute during the verify release step. See verifyReleaseCmd.
generateNotesCmdThe shell command to execute during the generate notes step. See generateNotesCmd.
prepareCmdThe shell command to execute during the prepare step. See prepareCmd.
addChannelCmdThe shell command to execute during the add channel step. See addChannelCmd.
publishCmdThe shell command to execute during the publish step. See publishCmd.
successCmdThe shell command to execute during the success step. See successCmd.
failCmdThe shell command to execute during the fail step. See failCmd.
shellThe shell to use to run the command. See execa#shell.
execCwdThe path to use as current working directory when executing the shell commands. This path is relative to the path from which semantic-release is running. For example if semantic-release runs from /my-project and execCwd is set to buildScripts then the shell command will be executed from /my-project/buildScripts

Each shell command is generated with Lodash template. All the objects passed to the semantic-release plugins are available as template options.

verifyConditionsCmd

Execute a shell command to verify if the release should happen.

Command propertyDescription
exit code0 if the verification is successful, or any other exit code otherwise.
stdoutWrite only the reason for the verification to fail.
stderrCan be used for logging.

analyzeCommitsCmd

Command propertyDescription
exit codeAny non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error.
stdoutOnly 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.
stderrCan be used for logging.

verifyReleaseCmd

Command propertyDescription
exit code0 if the verification is successful, or any other exit code otherwise.
stdoutOnly the reason for the verification to fail can be written to stdout.
stderrCan be used for logging.

generateNotesCmd

Command propertyDescription
exit codeAny non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error.
stdoutOnly the release note must be written to stdout.
stderrCan be used for logging.

prepareCmd

Command propertyDescription
exit codeAny non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error.
stdoutCan be used for logging.
stderrCan be used for logging.

addChannelCmd

Command propertyDescription
exit codeAny non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error.
stdoutThe release information can be written to stdout as parseable JSON (for example {"name": "Release name", "url": "http://url/release/1.0.0"}). If the command write non parseable JSON to stdout no release information will be returned.
stderrCan be used for logging.

publishCmd

Command propertyDescription
exit codeAny non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error.
stdoutThe release information can be written to stdout as parseable JSON (for example {"name": "Release name", "url": "http://url/release/1.0.0"}). If the command write non parseable JSON to stdout no release information will be returned.
stderrCan be used for logging.

successCmd

Command propertyDescription
exit codeAny non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error.
stdoutCan be used for logging.
stderrCan be used for logging.

failCmd

Command propertyDescription
exit codeAny non 0 code is considered as an unexpected error and will stop the semantic-release execution with an error.
stdoutCan be used for logging.
stderrCan be used for logging.
@tonomy/tonomy-id-test@joelcox22/boilerplate@joelcox22/boilerplate-cdk@html-validate/semantic-releaseux-lib-testuser-friendly-time@infinitebrahmanuniverse/nolb-_semacitymapjob-web-app@everything-registry/sub-chunk-818@healform/liquid@ygorluiz/semanticsemantic-release-config-fabulatorsemantic-release-configsemantic-release-preconfigured-conventional-commitssemantic-release-upload-gcrsemantic-release-wellabesemantic-release-test-pipelinesemanticrelease-typo3ext-configdse-terraform-modulesstorydocker-utilities@digitalroute/semantic-release-configopen-sauced-semantic-config-test@bjoluc/semantic-release-config-poetry@carbonaut/release-docs@catalystsquad/release-config-composite-actions@catalystsquad/release-config-helm@catalystsquad/release-config-javascript-actions@catalystsquad/release-config-npm-no-publish@catalystsquad/release-config-template@cihelper/preset-semanticrelease-githubaction@cihelper/preset-semanticrelease-poetry@cihelper/semanticrelease-preset-generic@cihelper/semanticrelease-preset-githubaction@cihelper/semanticrelease-preset-goreleaser@cihelper/semanticrelease-preset-npm@clempat/semantic-release@snowball-tech/semantic-release-config@swarm-io/release-config-actions@swarm-io/release-config-helm@swarm-io/release-config-javascript-actions@swarm-io/release-config-template@swappland/market-contract-specconventional-changelog-config-emojicouchdb-stat-collector@bluebase/code-standards@blerpapp/semantic-release-config-serverless@anolilab/semantic-release-preset@anycli/semantic-releasebotella-project1botserverpraesentiumsapiente@developer_impetus/typegen1@droplt/semantic-release-config@alorel-personal/semantic-release-test@alexarts74/package-upload-wa-mapfe-antd-wealth-mgtevg-elama-test-semantic-npm@escape.tech/escape-js@elliemae/pui-cli@dword-design/base-config-app@dword-design/base-config-cli@dword-design/base-config-web-extension@dxcli/semantic-release@dxcli/dev-semantic-release@dvhb/oclif__semantic-release@edgelogistics/semantic-release@esthetic/wp-release@etclabscore/signatory@fcsukltd/config@radixdlt/radix-dapp-toolkit@ron0115/release-config-gitlab@saithodev/semantic-release-sharedconf-npm@sanity/semantic-release-preset@ruscon/nx-semantic-release-pnpm@maggioli-rd/semantic-release-base@mike-north/js-lib-semantic-release-config@mike-works/workshop-semantic-release-config@ngx-library/infrastructure@ng-easy/builders@shunkakinoki/semantic-release@owngames/semantic@rob.hameetman/semantic-release-config@qiwi/semrel-preset@pandagardenio/semantic-release-lite@netly/semantic-release-config@medijobs/release@master/cli@myparcel/semantic-release-config@oclif/semantic-release@oclif/semantic-release-dev@open-sauced/release@open-sauced/semantic-release-conventional-config@open-turo/semantic-release-config@openbench/release-config-helm@openbench/release-config@openbench/release-config-actions@up-ops/ops-semantic-release@urbandoor/lint@zaripych/ts-deps
6.0.3

2 years ago

6.0.2

2 years ago

6.0.1

3 years ago

6.0.0

3 years ago

5.0.0

4 years ago

4.0.0

4 years ago

3.4.0-beta.10

4 years ago

3.4.0-beta.9

4 years ago

3.4.0-beta.8

4 years ago

4.0.0-beta.1

4 years ago

3.4.0-beta.7

4 years ago

3.3.8

4 years ago

3.4.0-beta.6

5 years ago

3.4.0-beta.5

5 years ago

3.4.0-beta.4

5 years ago

3.4.0-beta.3

5 years ago

3.3.7

5 years ago

3.3.6

5 years ago

3.3.5

5 years ago

3.3.4

5 years ago

3.3.3

5 years ago

3.4.0-beta.2

5 years ago

3.3.2

5 years ago

3.4.0-beta.1

5 years ago

3.3.0-beta.2

5 years ago

3.3.1

5 years ago

3.3.0-beta.1

5 years ago

3.3.0

6 years ago

3.2.0

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.3.0

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago