JSPM

  • Created
  • Published
  • Downloads 383082
  • Score
    100M100P100Q182247F
  • License MIT

Set of semantic-release plugins to run custom scripts

Package Exports

  • @semantic-release/exec

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@semantic-release/exec) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@semantic-release/exec

Set of semantic-release plugins to execute custom shell commands.

Travis Codecov Greenkeeper badge

npm latest version npm next version

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"
    ]
  }
}