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.

168 lines
7.5 KiB

  1. # Configuration
  2. **semantic-release** configuration consist of:
  3. - Git repository options ([URL](#repositoryurl), [release branch](#branch) and [tag format](#tagformat))
  4. - [plugins](#plugins) definition
  5. - run mode ([debug](#debug), [dry run](#dryrun) and [local (no CI)](#ci))
  6. All those options can be configured directly or by extending a [shareable configuration](shareable-configurations.md).
  7. Additionally, metadata of Git tags generated by **semantic-release** can be customized via standard [Git environment variables](#git-environment-variables).
  8. ## Configuration file
  9. **semantic-release**’s [options](#options), mode and [plugins](plugins.md) can be set via:
  10. - A `.releaserc` file, written in YAML or JSON, with optional extensions: .`yaml`/`.yml`/`.json`/`.js`
  11. - A `release.config.js` file that exports an object
  12. - A `release` key in the project's `package.json` file
  13. Alternatively some options can be set via CLI arguments.
  14. The following three examples are the same.
  15. Via `release` key in the project's `package.json` file:
  16. ```json
  17. {
  18. "release": {
  19. "branch": "next"
  20. }
  21. }
  22. ```
  23. ```bash
  24. $ semantic-release
  25. ```
  26. Via `.releaserc` file:
  27. ```json
  28. {
  29. "branch": "next"
  30. }
  31. ```
  32. ```bash
  33. $ semantic-release
  34. ```
  35. Via CLI argument:
  36. ```bash
  37. $ semantic-release --branch next
  38. ```
  39. **Note**: CLI arguments take precedence over options configured in the configuration file.
  40. **Note**: Plugin options cannot be defined via CLI arguments and must be defined in the configuration file.
  41. **Note**: When configuring via `package.json`, the configuration must be under the `release` property. However, when using a `.releaserc` or a `release.config.js` file, the configuration must be set without a `release` property.
  42. ## Options
  43. ### extends
  44. Type: `Array`, `String`<br>
  45. CLI arguments: `-e`, `--extends`
  46. List of modules or file paths containing a [shareable configuration](shareable-configurations.md). If multiple shareable configurations are set, they will be imported in the order defined with each configuration option taking precedence over the options defined in a previous shareable configuration.
  47. **Note**: Options defined via CLI arguments or in the configuration file will take precedence over the ones defined in any shareable configuration.
  48. ### branch
  49. Type: `String`<br>
  50. Default: `master`<br>
  51. CLI arguments: `-b`, `--branch`
  52. The branch on which releases should happen.
  53. ### repositoryUrl
  54. Type: `String`<br>
  55. Default: `repository` property in `package.json` or [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)<br>
  56. CLI arguments: `-r`, `--repository-url`
  57. The git repository URL.
  58. Any valid git url format is supported (See [Git protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols)).
  59. ### tagFormat
  60. Type: `String`<br>
  61. Default: `v${version}`<br>
  62. CLI arguments: `-t`, `--tag-format`
  63. The [Git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) format used by **semantic-release** to identify releases. The tag name is generated with [Lodash template](https://lodash.com/docs#template) and will be compiled with the `version` variable.
  64. **Note**: The `tagFormat` must contain the `version` variable exactly once and compile to a [valid Git reference](https://git-scm.com/docs/git-check-ref-format#_description).
  65. ### plugins
  66. Type: `Array`<br>
  67. Default: `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']`<br>
  68. CLI arguments: `-p`, `--plugins`
  69. Define the list of plugins to use. Plugins will run in series, in the order defined, for each [steps](../../README.md#release-steps) if they implement it.
  70. Plugins configuration can defined by wrapping the name and an options object in an array.
  71. See [Plugins configuration](plugins.md#plugins) for more details.
  72. ### dryRun
  73. Type: `Boolean`<br>
  74. Default: `false` if running in a CI environment, `true` otherwise<br>
  75. CLI arguments: `-d`, `--dry-run`
  76. Dry-run mode, skip publishing, print next version and release notes.
  77. ### ci
  78. Type: `Boolean`<br>
  79. Default: `true`<br>
  80. CLI arguments: `--ci` / `--no-ci`
  81. Set to `false` to skip Continuous Integration environment verifications. This allows for making releases from a local machine.
  82. **Note**: The CLI arguments `--no-ci` is equivalent to `--ci false`.
  83. ### debug
  84. Type: `Boolean`<br>
  85. Default: `false`<br>
  86. CLI argument: `--debug`
  87. Output debugging information. It can also be enabled by setting the `DEBUG` environment variable to `semantic-release:*`.
  88. ## Git environment variables
  89. | Variable | Description | Default |
  90. |-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
  91. | `GIT_AUTHOR_NAME` | The author name associated with the [Git release tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging). See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot. |
  92. | `GIT_AUTHOR_EMAIL` | The author email associated with the [Git release tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging). See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot email address. |
  93. | `GIT_COMMITTER_NAME` | The committer name associated with the [Git release tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging). See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot. |
  94. | `GIT_COMMITTER_EMAIL` | The committer email associated with the [Git release tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging). See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot email address. |
  95. ## Existing version tags
  96. **semantic-release** uses [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) to determine the commits added since the last release. If a release have been published before setting up **semantic-release** you must make sure the most recent commit included in the last published release is in the [release branch](#branch) history and is tagged with the version released, formatted according to the [tag format](#tagformat) configured (defaults to `vx.y.z`).
  97. If the previous releases were published with [`npm publish`](https://docs.npmjs.com/cli/publish) this should already be the case.
  98. For example, if your release branch is `master`, the last release published on your project is `1.1.0` and the last commit included has the sha `1234567`, you must make sure this commit is in `master` history and is tagged with `v1.1.0`.
  99. ```bash
  100. # Make sure the commit 1234567 is in the release branch history
  101. $ git branch --contains 1234567
  102. # If the commit is not in the branch history it means that either:
  103. # - you use a different branch than the one your release from before
  104. # - or the commit sha has been rewritten (with git rebase)
  105. # In both cases you need to configure your repository to have the last release commit in the history of the release branch
  106. # List the tags for the commit 1234567
  107. $ git tag --contains 1234567
  108. # If v1.1.0 is not in the list you add it with
  109. $ git tag v1.1.0 1234567
  110. $ git push origin v1.1.0
  111. ```