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.

80 lines
5.2 KiB

  1. # Plugins
  2. Each [release step](../../README.md#release-steps) is implemented by configurable plugins. This allows for support of different [commit message formats](../../README.md#commit-message-format), release note generators and publishing platforms.
  3. A plugin is a npm module that can implement one or more of the following steps:
  4. | Step | Required | Description |
  5. |--------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  6. | `verifyConditions` | No | Responsible for verifying conditions necessary to proceed with the release: configuration is correct, authentication token are valid, etc... |
  7. | `analyzeCommits` | Yes | Responsible for determining the type of the next release (`major`, `minor` or `patch`). If multiple plugins with a `analyzeCommits` step are defined, the release type will be the highest one among plugins output. |
  8. | `verifyRelease` | No | Responsible for verifying the parameters (version, type, dist-tag etc...) of the release that is about to be published. |
  9. | `generateNotes` | No | Responsible for generating the content of the release note. If multiple plugins with a `generateNotes` step are defined, the release notes will be the result of the concatenation of each plugin output. |
  10. | `prepare` | No | Responsible for preparing the release, for example creating or updating files such as `package.json`, `CHANGELOG.md`, documentation or compiled assets and pushing a commit. |
  11. | `publish` | No | Responsible for publishing the release. |
  12. | `success` | No | Responsible for notifying of a new release. |
  13. | `fail` | No | Responsible for notifying of a failed release. |
  14. **Note:** If no plugin with a `analyzeCommits` step is defined `@semantic-release/commit-analyzer` will be used.
  15. See [available plugins](../extending/plugins-list.md).
  16. ## Plugins configuration
  17. Each plugin must be installed and configured with the [`plugins` options](./configuration.md#plugins) by specifying the list of plugins by npm module name.
  18. ```bash
  19. $ npm install @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/npm -D
  20. ```
  21. ```json
  22. {
  23. "plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/npm"]
  24. }
  25. ```
  26. ## Plugin ordering
  27. For each [release step](../../README.md#release-steps) the plugins that implement that step will be executed in the order in which the are defined.
  28. ```json
  29. {
  30. "plugins": [
  31. "@semantic-release/commit-analyzer",
  32. "@semantic-release/release-notes-generator",
  33. "@semantic-release/npm",
  34. "@semantic-release/git"
  35. ]
  36. }
  37. ```
  38. With this configuration **semantic-release** will:
  39. - execute the `verifyConditions` implementation of `@semantic-release/npm` then `@semantic-release/git`
  40. - execute the `analyzeCommits` implementation of `@semantic-release/commit-analyzer`
  41. - execute the `prepare` implementation of `@semantic-release/npm` then `@semantic-release/git`
  42. - execute the `generateNotes` implementation of `@semantic-release/release-notes-generator`
  43. - execute the `publish` implementation of `@semantic-release/npm`
  44. ## Plugin options
  45. A plugin options can specified by wrapping the name and an options object in an array. Options configured this way will be passed only to that specific plugin.
  46. Global plugin options can defined at the root of the **semantic-release** configuration object. Options configured this way will be passed to all plugins.
  47. ```json
  48. {
  49. "plugins": [
  50. "@semantic-release/commit-analyzer",
  51. "@semantic-release/release-notes-generator",
  52. ["@semantic-release/github", {
  53. "assets": ["dist/**"]
  54. }],
  55. "@semantic-release/git"
  56. ],
  57. "preset": "angular"
  58. }
  59. ```
  60. With this configuration:
  61. - All plugins will receive the `preset` option, which will be used by both `@semantic-release/commit-analyzer` and `@semantic-release/release-notes-generator` (and ignored by `@semantic-release/github` and `@semantic-release/git`)
  62. - The `@semantic-release/github` plugin will receive the `assets` options (`@semantic-release/git` will not receive it and therefore will use it's default value for that option)