Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
14 KiB

  1. # @semantic-release/exec
  2. [**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to execute custom shell commands.
  3. [![Travis](https://img.shields.io/travis/semantic-release/exec.svg)](https://travis-ci.org/semantic-release/exec)
  4. [![Codecov](https://img.shields.io/codecov/c/github/semantic-release/exec.svg)](https://codecov.io/gh/semantic-release/exec)
  5. [![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/exec.svg)](https://greenkeeper.io/)
  6. [![npm latest version](https://img.shields.io/npm/v/@semantic-release/exec/latest.svg)](https://www.npmjs.com/package/@semantic-release/exec)
  7. [![npm next version](https://img.shields.io/npm/v/@semantic-release/exec/next.svg)](https://www.npmjs.com/package/@semantic-release/exec)
  8. | Step | Description |
  9. |--------------------|---------------------------------------------------------------------------------------------------------|
  10. | `verifyConditions` | Execute a shell command to verify if the release should happen. |
  11. | `analyzeCommits` | Execute a shell command to determine the type of release. |
  12. | `verifyRelease` | Execute a shell command to verifying a release that was determined before and is about to be published. |
  13. | `generateNotes` | Execute a shell command to generate the release note. |
  14. | `prepare` | Execute a shell command to prepare the release. |
  15. | `publish` | Execute a shell command to publish the release. |
  16. | `success` | Execute a shell command to notify of a new release. |
  17. | `fail` | Execute a shell command to notify of a failed release. |
  18. ## Install
  19. ```bash
  20. $ npm install @semantic-release/exec -D
  21. ```
  22. ## Usage
  23. The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/configuration.md#configuration):
  24. ```json
  25. {
  26. "plugins": [
  27. "@semantic-release/commit-analyzer",
  28. "@semantic-release/release-notes-generator",
  29. ["@semantic-release/exec", {
  30. "verifyConditionsCmd": "./verify.sh",
  31. "publishCmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}"
  32. }],
  33. ]
  34. }
  35. ```
  36. With this example:
  37. - the shell command `./verify.sh` will be executed on the [verify conditions step](https://github.com/semantic-release/semantic-release#release-steps)
  38. - 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](https://github.com/semantic-release/semantic-release#release-steps)
  39. ## Configuration
  40. ### Options
  41. | Options | Description |
  42. |-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  43. | `verifyConditionsCmd` | The shell command to execute during the verify condition step. See [verifyConditionsCmd](#verifyconditionscmd). |
  44. | `analyzeCommitsCmd` | The shell command to execute during the analyze commits step. See [analyzeCommitsCmd](#analyzecommitscmd). |
  45. | `verifyReleaseCmd` | The shell command to execute during the verify release step. See [verifyReleaseCmd](#verifyreleasecmd). |
  46. | `generateNotesCmd` | The shell command to execute during the generate notes step. See [generateNotesCmd](#generatenotescmd). |
  47. | `prepareCmd` | The shell command to execute during the prepare step. See [prepareCmd](#preparecmd). |
  48. | `publishCmd` | The shell command to execute during the publish step. See [publishCmd](#publishcmd). |
  49. | `successCmd` | The shell command to execute during the success step. See [successCmd](#successcmd). |
  50. | `failCmd` | The shell command to execute during the fail step. See [failCmd](#failcmd). |
  51. | `shell` | The shell to use to run the command. See [execa#shell](https://github.com/sindresorhus/execa#shell). |
  52. | `execCwd` | The 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` |
  53. Each shell command is generated with [Lodash template](https://lodash.com/docs#template). All the objets passed to the [semantic-release plugins](https://github.com/semantic-release/semantic-release#plugins) are available as template options.
  54. ## verifyConditionsCmd
  55. Execute a shell command to verify if the release should happen.
  56. | Command property | Description |
  57. |------------------|--------------------------------------------------------------------------|
  58. | `exit code` | `0` if the verification is successful, or any other exit code otherwise. |
  59. | `stdout` | Write only the reason for the verification to fail. |
  60. | `stderr` | Can be used for logging. |
  61. ## analyzeCommitsCmd
  62. | Command property | Description |
  63. |------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
  64. | `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
  65. | `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`. |
  66. | `stderr` | Can be used for logging. |
  67. ## verifyReleaseCmd
  68. | Command property | Description |
  69. |------------------|--------------------------------------------------------------------------|
  70. | `exit code` | `0` if the verification is successful, or any other exit code otherwise. |
  71. | `stdout` | Only the reason for the verification to fail can be written to `stdout`. |
  72. | `stderr` | Can be used for logging. |
  73. ## generateNotesCmd
  74. | Command property | Description |
  75. |------------------|---------------------------------------------------------------------------------------------------------------------|
  76. | `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
  77. | `stdout` | Only the release note must be written to `stdout`. |
  78. | `stderr` | Can be used for logging. |
  79. ## prepareCmd
  80. | Command property | Description |
  81. |------------------|---------------------------------------------------------------------------------------------------------------------|
  82. | `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
  83. | `stdout` | Can be used for logging. |
  84. | `stderr` | Can be used for logging. |
  85. ## publishCmd
  86. | Command property | Description |
  87. |------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  88. | `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
  89. | `stdout` | The `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. |
  90. | `stderr` | Can be used for logging. |
  91. ## successCmd
  92. | Command property | Description |
  93. |------------------|---------------------------------------------------------------------------------------------------------------------|
  94. | `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
  95. | `stdout` | Can be used for logging. |
  96. | `stderr` | Can be used for logging. |
  97. ## failCmd
  98. | Command property | Description |
  99. |------------------|---------------------------------------------------------------------------------------------------------------------|
  100. | `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
  101. | `stdout` | Can be used for logging. |
  102. | `stderr` | Can be used for logging. |