semantic-release 15.13.17 → 15.13.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -34
- package/docs/{usage → 01-usage}/README.md +0 -0
- package/docs/{usage → 01-usage}/ci-configuration.md +30 -10
- package/docs/{usage → 01-usage}/configuration.md +131 -56
- package/docs/01-usage/getting-started.md +32 -0
- package/docs/01-usage/installation.md +22 -0
- package/docs/{usage → 01-usage}/plugins.md +19 -22
- package/docs/01-usage/shareable-configurations.md +7 -0
- package/docs/{extending → 02-extending}/README.md +0 -0
- package/docs/{extending → 02-extending}/plugins-list.md +0 -0
- package/docs/02-extending/shareable-configurations-list.md +13 -0
- package/docs/03-recipes/README.md +3 -0
- package/docs/03-recipes/ci-pipelines-recipes.md +4 -0
- package/docs/{recipes → 03-recipes}/circleci-workflows.md +4 -4
- package/docs/{recipes → 03-recipes}/git-auth-ssh-keys.md +1 -1
- package/docs/03-recipes/git-hosted-services.md +2 -0
- package/docs/{recipes → 03-recipes}/gitlab-ci.md +4 -4
- package/docs/03-recipes/package-managers-and-languages.md +2 -0
- package/docs/{recipes → 03-recipes}/travis.md +6 -6
- package/docs/{developer-guide → 04-developer-guide}/README.md +0 -0
- package/docs/{developer-guide → 04-developer-guide}/js-api.md +3 -3
- package/docs/04-developer-guide/plugin.md +106 -0
- package/docs/{developer-guide → 04-developer-guide}/shareable-configuration.md +0 -0
- package/docs/{support → 05-support}/FAQ.md +19 -19
- package/docs/{support → 05-support}/README.md +0 -0
- package/docs/{support → 05-support}/node-support-policy.md +0 -0
- package/docs/{support → 05-support}/node-version.md +1 -1
- package/docs/{support → 05-support}/resources.md +0 -0
- package/docs/{support → 05-support}/troubleshooting.md +0 -0
- package/docs/README.md +5 -5
- package/lib/git.js +3 -3
- package/package.json +6 -14
- package/docs/developer-guide/plugin.md +0 -1
- package/docs/extending/shareable-configurations-list.md +0 -7
- package/docs/recipes/README.md +0 -11
- package/docs/usage/getting-started.md +0 -22
- package/docs/usage/installation.md +0 -29
- package/docs/usage/shareable-configurations.md +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Shareable configurations list
|
|
2
|
+
|
|
3
|
+
## Official configurations
|
|
4
|
+
- [@semantic-release/apm-config](https://github.com/semantic-release/apm-config) - semantic-release shareable configuration for releasing atom packages
|
|
5
|
+
- [@semantic-release/gitlab-config](https://github.com/semantic-release/gitlab-config) - semantic-release shareable configuration for GitLab
|
|
6
|
+
|
|
7
|
+
## Community configurations
|
|
8
|
+
- [@jedmao/semantic-release-npm-github-config](https://github.com/jedmao/semantic-release-npm-github-config)
|
|
9
|
+
- Provides an informative [git](https://github.com/semantic-release/git) commit message for the release commit that does not trigger continuous integration and conforms to the [conventional commits specification](https://www.conventionalcommits.org/) (e.g., "chore(release): 1.2.3 [skip ci]\n\nnotes").
|
|
10
|
+
- Creates a tarball that gets uploaded with each [GitHub release](https://github.com/semantic-release/github).
|
|
11
|
+
- Publishes the same tarball to [npm](https://github.com/semantic-release/npm).
|
|
12
|
+
- Commits the version change in `package.json`.
|
|
13
|
+
- Creates or updates a [changelog](https://github.com/semantic-release/changelog) file.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Environment variables
|
|
4
4
|
|
|
5
|
-
The [Authentication](../usage/ci-configuration.md#authentication) environment variables can be configured in [CircleCi Project Settings](https://circleci.com/docs/2.0/env-vars/#adding-environment-variables-in-the-app)..
|
|
5
|
+
The [Authentication](../01-usage/ci-configuration.md#authentication) environment variables can be configured in [CircleCi Project Settings](https://circleci.com/docs/2.0/env-vars/#adding-environment-variables-in-the-app)..
|
|
6
6
|
|
|
7
|
-
Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with semantic-release-cli](../usage/getting-started.md#
|
|
7
|
+
Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with semantic-release-cli](../01-usage/getting-started.md#guided-setup-through-semantic-release-cli).
|
|
8
8
|
|
|
9
9
|
## Multiple Node jobs configuration
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with
|
|
|
12
12
|
|
|
13
13
|
This example is a minimal configuration for **semantic-release** with a build running Node 6 and 8. See [CircleCI documentation](https://circleci.com/docs/2.0) for additional configuration options.
|
|
14
14
|
|
|
15
|
-
This example create the workflows `test_node_4`, `test_node_6`, `test_node_8` and `release`. The release workflows will [run `semantic-release` only after the all the `test_node_*` are successful](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
15
|
+
This example create the workflows `test_node_4`, `test_node_6`, `test_node_8` and `release`. The release workflows will [run `semantic-release` only after the all the `test_node_*` are successful](../01-usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
16
16
|
|
|
17
17
|
```yaml
|
|
18
18
|
version: 2
|
|
@@ -54,7 +54,7 @@ workflows:
|
|
|
54
54
|
|
|
55
55
|
### `package.json` configuration for multiple Node jobs
|
|
56
56
|
|
|
57
|
-
A `package.json` is required only for [local](../usage/installation.md#local-installation) **semantic-release** installation.
|
|
57
|
+
A `package.json` is required only for [local](../01-usage/installation.md#local-installation) **semantic-release** installation.
|
|
58
58
|
|
|
59
59
|
```json
|
|
60
60
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Git authentication with SSH keys
|
|
2
2
|
|
|
3
|
-
When using [environment variables](../usage/ci-configuration.md#authentication) to set up the Git authentication, the remote Git repository will automatically be accessed via [https](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_http_protocols), independently of the [`repositoryUrl`](../usage/configuration.md#repositoryurl) format configured in the **semantic-release** [Configuration](../usage/configuration.md#configuration) (the format will be automatically converted as needed).
|
|
3
|
+
When using [environment variables](../01-usage/ci-configuration.md#authentication) to set up the Git authentication, the remote Git repository will automatically be accessed via [https](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_http_protocols), independently of the [`repositoryUrl`](../01-usage/configuration.md#repositoryurl) format configured in the **semantic-release** [Configuration](../01-usage/configuration.md#configuration) (the format will be automatically converted as needed).
|
|
4
4
|
|
|
5
5
|
Alternatively the Git repository can be accessed via [SSH](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_ssh_protocol) by creating SSH keys, adding the public one to your Git hosted account and making the private one available on the CI environment.
|
|
6
6
|
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## Environment variables
|
|
4
4
|
|
|
5
|
-
The [Authentication](../usage/ci-configuration.md#authentication) environment variables can be configured with [Secret variables](https://docs.gitlab.com/ce/ci/variables/README.html#secret-variables).
|
|
5
|
+
The [Authentication](../01-usage/ci-configuration.md#authentication) environment variables can be configured with [Secret variables](https://docs.gitlab.com/ce/ci/variables/README.html#secret-variables).
|
|
6
6
|
|
|
7
7
|
## Node project configuration
|
|
8
8
|
|
|
9
9
|
GitLab CI supports [Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html) allowing to test on multiple Node versions and publishing a release only when all test pass.
|
|
10
10
|
|
|
11
|
-
**Note**: The publish pipeline must run a [Node >= 8 version](../support/FAQ.md#why-does-semantic-release-require-node-version--83).
|
|
11
|
+
**Note**: The publish pipeline must run a [Node >= 8 version](../05-support/FAQ.md#why-does-semantic-release-require-node-version--83).
|
|
12
12
|
|
|
13
13
|
### `.gitlab-ci.yml` configuration for Node projects
|
|
14
14
|
|
|
15
15
|
This example is a minimal configuration for **semantic-release** with a build running Node 6 and 8. See [GitLab CI - Configuration of your jobs with .gitlab-ci.yml](https://docs.gitlab.com/ee/ci/yaml/README.html) for additional configuration options.
|
|
16
16
|
|
|
17
|
-
**Note**: The`semantic-release` execution command varies depending if you are using a [local](../usage/installation.md#local-installation) or [global](../usage/installation.md#global-installation) **semantic-release** installation.
|
|
17
|
+
**Note**: The`semantic-release` execution command varies depending if you are using a [local](../01-usage/installation.md#local-installation) or [global](../01-usage/installation.md#global-installation) **semantic-release** installation.
|
|
18
18
|
|
|
19
19
|
```yaml
|
|
20
20
|
# The release pipeline will run only if all jobs in the test pipeline are successful
|
|
@@ -46,7 +46,7 @@ publish:
|
|
|
46
46
|
|
|
47
47
|
### `package.json` configuration
|
|
48
48
|
|
|
49
|
-
A `package.json` is required only for [local](../usage/installation.md#local-installation) **semantic-release** installation.
|
|
49
|
+
A `package.json` is required only for [local](../01-usage/installation.md#local-installation) **semantic-release** installation.
|
|
50
50
|
|
|
51
51
|
```json
|
|
52
52
|
{
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Environment variables
|
|
4
4
|
|
|
5
|
-
The [Authentication](../usage/ci-configuration.md#authentication) environment variables can be configured in [Travis Repository Settings](https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-Settings) or with the [travis env set CLI](https://github.com/travis-ci/travis.rb#env).
|
|
5
|
+
The [Authentication](../01-usage/ci-configuration.md#authentication) environment variables can be configured in [Travis Repository Settings](https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-Settings) or with the [travis env set CLI](https://github.com/travis-ci/travis.rb#env).
|
|
6
6
|
|
|
7
|
-
Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with semantic-release-cli](../usage/getting-started.md#getting-started).
|
|
7
|
+
Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with semantic-release-cli](../01-usage/01-getting-started.md#getting-started).
|
|
8
8
|
|
|
9
9
|
## Node.js projects configuration
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with
|
|
|
12
12
|
|
|
13
13
|
This example is a minimal configuration for **semantic-release** with a build running Node 6 and 8. See [Travis - Customizing the Build](https://docs.travis-ci.com/user/customizing-the-build) for additional configuration options.
|
|
14
14
|
|
|
15
|
-
This example creates a `release` [build stage](https://docs.travis-ci.com/user/build-stages) that [runs `semantic-release` only after all test jobs are successful](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
15
|
+
This example creates a `release` [build stage](https://docs.travis-ci.com/user/build-stages) that [runs `semantic-release` only after all test jobs are successful](../01-usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
16
16
|
|
|
17
17
|
It's recommended to run the `semantic-release` command in the [Travis `deploy` step](https://docs.travis-ci.com/user/customizing-the-build/#The-Build-Lifecycle) so if an error occurs the build will fail and Travis will send a notification.
|
|
18
18
|
|
|
@@ -43,7 +43,7 @@ jobs:
|
|
|
43
43
|
|
|
44
44
|
### `package.json` configuration for multiple Node jobs
|
|
45
45
|
|
|
46
|
-
A `package.json` is required only for [local](../usage/installation.md#local-installation) **semantic-release** installation.
|
|
46
|
+
A `package.json` is required only for [local](../01-usage/installation.md#local-installation) **semantic-release** installation.
|
|
47
47
|
|
|
48
48
|
```json
|
|
49
49
|
{
|
|
@@ -57,13 +57,13 @@ A `package.json` is required only for [local](../usage/installation.md#local-ins
|
|
|
57
57
|
|
|
58
58
|
For projects that require to be tested with one or multiple version of a Non-JavaScript [language](https://docs.travis-ci.com/user/languages), optionally on multiple [Operating Systems](https://docs.travis-ci.com/user/multi-os).
|
|
59
59
|
|
|
60
|
-
This recipe cover the Travis specifics only. See [Non JavaScript projects recipe](../support/FAQ.md#can-i-use-semantic-release-to-publish-non-javascript-packages) for more information on the **semantic-release** configuration.
|
|
60
|
+
This recipe cover the Travis specifics only. See [Non JavaScript projects recipe](../05-support/FAQ.md#can-i-use-semantic-release-to-publish-non-javascript-packages) for more information on the **semantic-release** configuration.
|
|
61
61
|
|
|
62
62
|
### `.travis.yml` configuration for non-JavaScript projects
|
|
63
63
|
|
|
64
64
|
This example is a minimal configuration for **semantic-release** with a build running [Go 1.6 and 1.7](https://docs.travis-ci.com/user/languages/go). See [Travis - Customizing the Build](https://docs.travis-ci.com/user/customizing-the-build) for additional configuration options.
|
|
65
65
|
|
|
66
|
-
This example creates a `release` [build stage](https://docs.travis-ci.com/user/build-stages) that [runs `semantic-release` only after all test jobs are successful](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
66
|
+
This example creates a `release` [build stage](https://docs.travis-ci.com/user/build-stages) that [runs `semantic-release` only after all test jobs are successful](../01-usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
67
67
|
|
|
68
68
|
It's recommended to run the `semantic-release` command in the [Travis `deploy` step](https://docs.travis-ci.com/user/customizing-the-build/#The-Build-Lifecycle) so if an error occurs the build will fail and Travis will send a notification.
|
|
69
69
|
|
|
File without changes
|
|
@@ -65,9 +65,9 @@ Type: `Object`
|
|
|
65
65
|
|
|
66
66
|
**semantic-release** options.
|
|
67
67
|
|
|
68
|
-
Can be used to set any [core option](../usage/configuration.md#configuration) or [plugin options](../usage/plugins.md#configuration).
|
|
68
|
+
Can be used to set any [core option](../01-usage/configuration.md#configuration) or [plugin options](../01-usage/plugins.md#configuration).
|
|
69
69
|
|
|
70
|
-
Each option, will take precedence over options configured in the [configuration file](../usage/configuration.md#configuration) and [shareable configurations](../usage/configuration.md#extends).
|
|
70
|
+
Each option, will take precedence over options configured in the [configuration file](../01-usage/configuration.md#configuration) and [shareable configurations](../01-usage/configuration.md#extends).
|
|
71
71
|
|
|
72
72
|
#### config
|
|
73
73
|
|
|
@@ -229,7 +229,7 @@ Example:
|
|
|
229
229
|
|
|
230
230
|
Type: `Array<Object>`
|
|
231
231
|
|
|
232
|
-
The list of releases published, one release per [publish plugin](../usage/plugins.md#publish-plugin).<br>
|
|
232
|
+
The list of releases published, one release per [publish plugin](../01-usage/plugins.md#publish-plugin).<br>
|
|
233
233
|
Each release object has the following properties:
|
|
234
234
|
|
|
235
235
|
| Name | Type | Description |
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Plugin Developer Guide
|
|
2
|
+
|
|
3
|
+
To create a plugin for `semantic-release`, you need to decide which parts of the release lifecycle are important to that plugin. For example, it is best to always have a `verify` step because you may be receiving inputs from a user and want to make sure they exist. A plugin can abide by any of the following lifecycles:
|
|
4
|
+
|
|
5
|
+
- `verify`
|
|
6
|
+
- `prepare`
|
|
7
|
+
- `publish`
|
|
8
|
+
- `success`
|
|
9
|
+
- `fail`
|
|
10
|
+
|
|
11
|
+
`semantic-release` will require the plugin via `node` and look through the required object for methods named like the lifecyles stated above. For example, if your plugin only had a `verify` and `success` step, the `main` file for your object would need to `export` an object with `verify` and `success` functions.
|
|
12
|
+
|
|
13
|
+
In addition to the lifecycle methods, each lifecyle is passed two objects:
|
|
14
|
+
|
|
15
|
+
1. `pluginConfig` - an object containing the options that a user may pass in via their `release.config.js` file (or similar)
|
|
16
|
+
2. `context` - provided by `semantic-release` for access to things like `env` variables set on the running process.
|
|
17
|
+
|
|
18
|
+
For each lifecycle you create, you will want to ensure it can accept `pluginConfig` and `context` as parameters.
|
|
19
|
+
|
|
20
|
+
## Creating a Plugin Project
|
|
21
|
+
|
|
22
|
+
It is recommended that you generate a new project with `yarn init`. This will provide you with a basic node project to get started with. From there, create an `index.js` file, and make sure it is specified as the `main` in the `package.json`. We will use this file to orchestrate the lifecycle methods later on.
|
|
23
|
+
|
|
24
|
+
Next, create a `src` or `lib` folder in the root of the project. This is where we will store our logic and code for how our lifecycle methods work. Finally, create a `test` folder so you can write tests related to your logic.
|
|
25
|
+
|
|
26
|
+
We recommend you setup a linting system to ensure good javascript practices are enforced. ESLint is usually the system of choice, and the configuration can be whatever you or your team fancies.
|
|
27
|
+
|
|
28
|
+
## Exposing Lifecycle Methods
|
|
29
|
+
|
|
30
|
+
In your `index.js` file, you can start by writing the following code
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
33
|
+
const verifyConditions = require('./src/verify');
|
|
34
|
+
|
|
35
|
+
let verified;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Called by semantic-release during the verification step
|
|
39
|
+
* @param {*} pluginConfig The semantic-release plugin config
|
|
40
|
+
* @param {*} context The context provided by semantic-release
|
|
41
|
+
*/
|
|
42
|
+
async function verify(pluginConfig, context) {
|
|
43
|
+
await verifyConditions(pluginConfig, context);
|
|
44
|
+
verified = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = { verify };
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then, in your `src` folder, create a file called `verify.js` and add the following
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
const AggregateError = require('aggregate-error');
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A method to verify that the user has given us a slack webhook url to post to
|
|
57
|
+
*/
|
|
58
|
+
module.exports = async (pluginConfig, context) => {
|
|
59
|
+
const { logger } = context;
|
|
60
|
+
const errors = [];
|
|
61
|
+
|
|
62
|
+
// Throw any errors we accumulated during the validation
|
|
63
|
+
if (errors.length > 0) {
|
|
64
|
+
throw new AggregateError(errors);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
As of right now, this code won't do anything. However, if you were to run this plugin via `semantic-release`, it would run when the `verify` step occurred.
|
|
70
|
+
|
|
71
|
+
Following this structure, you can create different steps and checks to run through out the release process.
|
|
72
|
+
|
|
73
|
+
## Supporting Options
|
|
74
|
+
|
|
75
|
+
Let's say we want to verify that an `option` is passed. An `option` is a configuration object that is specific to your plugin. For example, the user may set an `option` in their release config like:
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
{
|
|
79
|
+
prepare: {
|
|
80
|
+
path: "@semantic-release/my-special-plugin"
|
|
81
|
+
message: "My cool release message"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This `message` option will be passed to the `pluginConfig` object mentioned earlier. We can use the validation method we created to verify this option exists so we can perform logic based on that knowledge. In our `verify` file, we can add the following:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
const { message } = pluginConfig;
|
|
90
|
+
|
|
91
|
+
if (message.length) {
|
|
92
|
+
//...
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Supporting Environment Variables
|
|
97
|
+
|
|
98
|
+
Similar to `options`, environment variables exist to allow users to pass tokens and set special URLs. These are set on the `context` object instead of the `pluginConfig` object. Let's say we wanted to check for `GITHUB_TOKEN` in the environment because we want to post to GitHub on the user's behalf. To do this, we can add the following to our `verify` command:
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
const { env } = context;
|
|
102
|
+
|
|
103
|
+
if (env.GITHUB_TOKEN) {
|
|
104
|
+
//...
|
|
105
|
+
}
|
|
106
|
+
```
|
|
File without changes
|
|
@@ -34,11 +34,11 @@ If using npm hook scripts is not possible, and alternative solution is to [`@sem
|
|
|
34
34
|
|
|
35
35
|
## Is there a way to preview which version would currently get published?
|
|
36
36
|
|
|
37
|
-
Yes with the [dry-run options](../usage/configuration.md#dryrun) which prints to the console the next version to be published and the release notes.
|
|
37
|
+
Yes with the [dry-run options](../01-usage/configuration.md#dryrun) which prints to the console the next version to be published and the release notes.
|
|
38
38
|
|
|
39
39
|
## Can I use semantic-release with Yarn?
|
|
40
40
|
|
|
41
|
-
If you are using a [local](../usage/installation.md#local-installation) **semantic-release** installation and run multiple CI jobs with different versions, the `yarn install` command will fail on jobs running with Node < 8 as **semantic-release** requires [Node >= 8.3](#why-does-semantic-release-require-node-version--83) and specifies it in its `package.json`s [`engines`](https://docs.npmjs.com/files/package.json#engines) key.
|
|
41
|
+
If you are using a [local](../01-usage/installation.md#local-installation) **semantic-release** installation and run multiple CI jobs with different versions, the `yarn install` command will fail on jobs running with Node < 8 as **semantic-release** requires [Node >= 8.3](#why-does-semantic-release-require-node-version--83) and specifies it in its `package.json`s [`engines`](https://docs.npmjs.com/files/package.json#engines) key.
|
|
42
42
|
|
|
43
43
|
The recommended solution is to use the [Yarn](https://yarnpkg.com) [--ignore-engines](https://yarnpkg.com/en/docs/cli/install#toc-yarn-install-ignore-engines) option to install the project dependencies on the CI environment, so Yarn will ignore the **semantic-release**'s `engines` key:
|
|
44
44
|
|
|
@@ -48,7 +48,7 @@ $ yarn install --ignore-engines
|
|
|
48
48
|
|
|
49
49
|
**Note**: Several CI services use Yarn by default if your repository contains a `yarn.lock` file. So you should override the install step to specify `yarn install --ignore-engines`.
|
|
50
50
|
|
|
51
|
-
Alternatively you can use a [global](../usage/installation.md#global-installation) **semantic-release** installation and make sure to install and run the `semantic-release` command only in a CI jobs running with Node >= 8.3.
|
|
51
|
+
Alternatively you can use a [global](../01-usage/installation.md#global-installation) **semantic-release** installation and make sure to install and run the `semantic-release` command only in a CI jobs running with Node >= 8.3.
|
|
52
52
|
|
|
53
53
|
If your CI environment provides [nvm](https://github.com/creationix/nvm) you can switch to Node 8 before installing and running the `semantic-release` command:
|
|
54
54
|
|
|
@@ -56,14 +56,14 @@ If your CI environment provides [nvm](https://github.com/creationix/nvm) you can
|
|
|
56
56
|
$ nvm install 8 && yarn global add semantic-release && semantic-release
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
See the [CI
|
|
59
|
+
See the [CI pipelines recipes](../03-recipes/ci-pipelines-recipes.md) for more details on specific CI environments.
|
|
60
60
|
|
|
61
61
|
As `semantic-release` is recommended to be executed with [`npx`](https://www.npmjs.com/package/npx) an alternative is required for usage with Yarn. Even though it is possible to install npx with Yarn, it's not recommended. Yarn and npx would be using different cache locations.
|
|
62
62
|
|
|
63
|
-
For [local installation](../usage/installation.md#local-installation) replace
|
|
63
|
+
For [local installation](../01-usage/installation.md#local-installation) replace
|
|
64
64
|
`npx semantic-release` with `yarn run semantic-release`.
|
|
65
65
|
|
|
66
|
-
For [global installation](../usage/installation.md#global-installation) replace
|
|
66
|
+
For [global installation](../01-usage/installation.md#global-installation) replace
|
|
67
67
|
`npx semantic-release` with `yarn global add semantic-release && semantic-release`.
|
|
68
68
|
|
|
69
69
|
## Can I use semantic-release to publish non-JavaScript packages?
|
|
@@ -71,13 +71,13 @@ For [global installation](../usage/installation.md#global-installation) replace
|
|
|
71
71
|
Yes, **semantic-release** is a Node CLI application but it can be used to publish any type of packages.
|
|
72
72
|
|
|
73
73
|
To publish a non-Node package (without a `package.json`) you would need to:
|
|
74
|
-
- Use a [global](../usage/installation.md#global-installation) **semantic-release** installation
|
|
75
|
-
- Set **semantic-release** [options](../usage/configuration.md#options) via [CLI arguments or rc file](../usage/configuration.md#configuration)
|
|
74
|
+
- Use a [global](../01-usage/installation.md#global-installation) **semantic-release** installation
|
|
75
|
+
- Set **semantic-release** [options](../01-usage/configuration.md#options) via [CLI arguments or rc file](../01-usage/configuration.md#configuration)
|
|
76
76
|
- Make sure your CI job executing the `semantic-release` command has access to [Node >= 8](#why-does-semantic-release-require-node-version--83) to execute the `semantic-release` command
|
|
77
77
|
|
|
78
|
-
See the [CI
|
|
78
|
+
See the [CI pipelines recipes](../03-recipes/ci-pipelines-recipes.md) for more details on specific CI environments.
|
|
79
79
|
|
|
80
|
-
In addition you will need to configure the **semantic-release** [plugins](../usage/plugins.md#plugins) to disable the [`@semantic-release/npm`](https://github.com/semantic-release/npm) plugin which is used by default and use a plugin for your project type.
|
|
80
|
+
In addition you will need to configure the **semantic-release** [plugins](../01-usage/plugins.md#plugins) to disable the [`@semantic-release/npm`](https://github.com/semantic-release/npm) plugin which is used by default and use a plugin for your project type.
|
|
81
81
|
|
|
82
82
|
If there is no specific plugin for your project type you can use the [`@semantic-release/exec`](https://github.com/semantic-release/exec) plugin to publish the release with a shell command.
|
|
83
83
|
|
|
@@ -99,19 +99,19 @@ Here is a basic example to create [GitHub releases](https://help.github.com/arti
|
|
|
99
99
|
|
|
100
100
|
**Note**: This is a theoretical example where the command `set-version` update the project version with the value passed as its first argument and `publish-package` publishes the package to a registry.
|
|
101
101
|
|
|
102
|
-
See the [package managers and languages recipes](../recipes/README.md#package-managers-and-languages) for more details on specific project types.
|
|
102
|
+
See the [package managers and languages recipes](../03-recipes/README.md#package-managers-and-languages) for more details on specific project types.
|
|
103
103
|
|
|
104
104
|
## Can I use semantic-release with any CI service?
|
|
105
105
|
|
|
106
106
|
Yes, **semantic-release** can be used with any CI service, as long as it provides:
|
|
107
|
-
- A way to set [authentication](../usage/ci-configuration.md#authentication) via environment variables
|
|
108
|
-
- A way to guarantee that the `semantic-release` command is [executed only after all the tests of all the jobs in the CI build pass](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded)
|
|
107
|
+
- A way to set [authentication](../01-usage/ci-configuration.md#authentication) via environment variables
|
|
108
|
+
- A way to guarantee that the `semantic-release` command is [executed only after all the tests of all the jobs in the CI build pass](../01-usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded)
|
|
109
109
|
|
|
110
|
-
See the [CI
|
|
110
|
+
See the [CI pipelines recipes](../03-recipes/ci-pipelines-recipes.md) for more details on specific CI environments.
|
|
111
111
|
|
|
112
112
|
## Can I run semantic-release on my local machine rather than on a CI server?
|
|
113
113
|
|
|
114
|
-
Yes, you can by explicitly setting the [`--no-ci` CLI option](../usage/configuration.md#ci) option. You will also have to set the required [authentication](../usage/ci-configuration.md#authentication) via environment variables on your local machine, for example:
|
|
114
|
+
Yes, you can by explicitly setting the [`--no-ci` CLI option](../01-usage/configuration.md#ci) option. You will also have to set the required [authentication](../01-usage/ci-configuration.md#authentication) via environment variables on your local machine, for example:
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
117
|
$ NPM_TOKEN=<your_npm_token> GH_TOKEN=<your_github_token> npx semantic-release --no-ci
|
|
@@ -123,11 +123,11 @@ However this is not the recommended approach, as running unit and integration te
|
|
|
123
123
|
|
|
124
124
|
Yes, with the [`@semantic-release/gitlab-config`](https://github.com/semantic-release/gitlab-config) shareable configuration.
|
|
125
125
|
|
|
126
|
-
See the [GitLab CI recipes](../recipes/gitlab-ci.md#using-semantic-release-with-gitlab-ci) for the CI configuration.
|
|
126
|
+
See the [GitLab CI recipes](../03-recipes/gitlab-ci.md#using-semantic-release-with-gitlab-ci) for the CI configuration.
|
|
127
127
|
|
|
128
128
|
## Can I use semantic-release with any Git hosted environment?
|
|
129
129
|
|
|
130
|
-
By default **semantic-release** uses the [`@semantic-release/github`](https://github.com/semantic-release/github) plugin to publish a [GitHub release](https://help.github.com/articles/about-releases). For other Git hosted environment the [`@semantic-release/git`](https://github.com/semantic-release/git) and [`@semantic-release/changelog`](https://github.com/semantic-release/changelog) plugins can be used via [plugins configuration](../usage/plugins.md).
|
|
130
|
+
By default **semantic-release** uses the [`@semantic-release/github`](https://github.com/semantic-release/github) plugin to publish a [GitHub release](https://help.github.com/articles/about-releases). For other Git hosted environment the [`@semantic-release/git`](https://github.com/semantic-release/git) and [`@semantic-release/changelog`](https://github.com/semantic-release/changelog) plugins can be used via [plugins configuration](../01-usage/plugins.md).
|
|
131
131
|
|
|
132
132
|
See the [`@semantic-release/git`](https://github.com/semantic-release/git#semantic-releasegit) [`@semantic-release/changelog`](https://github.com/semantic-release/changelog#semantic-releasechangelog) plugins documentation for more details.
|
|
133
133
|
|
|
@@ -230,13 +230,13 @@ See [“Introduction to SemVer” - Irina Gebauer](https://blog.greenkeeper.io/i
|
|
|
230
230
|
|
|
231
231
|
**semantic-release** has a full unit and integration test suite that tests `npm` publishes against the [npm-registry-couchapp](https://github.com/npm/npm-registry-couchapp).
|
|
232
232
|
|
|
233
|
-
In addition the [verify conditions step](../../README.md#release-steps) verifies that all necessary conditions for proceeding with a release are met, and a new release will be performed [only if all your tests pass](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
233
|
+
In addition the [verify conditions step](../../README.md#release-steps) verifies that all necessary conditions for proceeding with a release are met, and a new release will be performed [only if all your tests pass](../01-usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
234
234
|
|
|
235
235
|
## Why does semantic-release require Node version >= 8.3?
|
|
236
236
|
|
|
237
237
|
**semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 8.3 or higher**.
|
|
238
238
|
|
|
239
|
-
See [Node version requirement](
|
|
239
|
+
See [Node version requirement](/node-version.md#node-version-requirement) for more details and solutions.
|
|
240
240
|
|
|
241
241
|
## What is npx?
|
|
242
242
|
|
|
File without changes
|
|
File without changes
|
|
@@ -12,7 +12,7 @@ See our [Node Support Policy](node-support-policy.md) for our long-term promise
|
|
|
12
12
|
|
|
13
13
|
The recommended approach is to run the `semantic-release` command from a CI job running on Node 8.3 or higher. This can either be a job used by your project to test on Node >= 8.3 or a dedicated job for the release steps.
|
|
14
14
|
|
|
15
|
-
See [CI configuration](../usage/ci-configuration.md) and [CI
|
|
15
|
+
See [CI configuration](../01-usage/ci-configuration.md) and [CI pipelines recipes](../03-recipes/ci-pipelines-recipes.md) for more details.
|
|
16
16
|
|
|
17
17
|
## Alternative solutions
|
|
18
18
|
|
|
File without changes
|
|
File without changes
|
package/docs/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# semantic-release documentation
|
|
2
2
|
|
|
3
|
-
- [Usage](usage/README.md) - **semantic-release** installation and configuration
|
|
4
|
-
- [Extending](extending/README.md)- Extending **semantic-release** with plugins and shareable configurations
|
|
5
|
-
- [Recipes](recipes/README.md) - Community written recipes for common **semantic-release** use-cases
|
|
6
|
-
- [Developer Guide](developer-guide/README.md) - The essentials of writing a **semantic-release** plugin or shareable configurations
|
|
7
|
-
- [Support](support/README.md) - FAQ and troubleshooting
|
|
3
|
+
- [Usage](01-usage/README.md) - **semantic-release** installation and configuration
|
|
4
|
+
- [Extending](02-extending/README.md)- Extending **semantic-release** with plugins and shareable configurations
|
|
5
|
+
- [Recipes](03-recipes/README.md) - Community written recipes for common **semantic-release** use-cases
|
|
6
|
+
- [Developer Guide](04-developer-guide/README.md) - The essentials of writing a **semantic-release** plugin or shareable configurations
|
|
7
|
+
- [Support](05-support/README.md) - FAQ and troubleshooting
|
package/lib/git.js
CHANGED
|
@@ -45,7 +45,7 @@ async function isRefInHistory(ref, execaOpts) {
|
|
|
45
45
|
await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD'], execaOpts);
|
|
46
46
|
return true;
|
|
47
47
|
} catch (error) {
|
|
48
|
-
if (error.
|
|
48
|
+
if (error.code === 1) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -103,7 +103,7 @@ async function repoUrl(execaOpts) {
|
|
|
103
103
|
*/
|
|
104
104
|
async function isGitRepo(execaOpts) {
|
|
105
105
|
try {
|
|
106
|
-
return (await execa('git', ['rev-parse', '--git-dir'], execaOpts)).
|
|
106
|
+
return (await execa('git', ['rev-parse', '--git-dir'], execaOpts)).code === 0;
|
|
107
107
|
} catch (error) {
|
|
108
108
|
debug(error);
|
|
109
109
|
}
|
|
@@ -161,7 +161,7 @@ async function push(repositoryUrl, execaOpts) {
|
|
|
161
161
|
*/
|
|
162
162
|
async function verifyTagName(tagName, execaOpts) {
|
|
163
163
|
try {
|
|
164
|
-
return (await execa('git', ['check-ref-format', `refs/tags/${tagName}`], execaOpts)).
|
|
164
|
+
return (await execa('git', ['check-ref-format', `refs/tags/${tagName}`], execaOpts)).code === 0;
|
|
165
165
|
} catch (error) {
|
|
166
166
|
debug(error);
|
|
167
167
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semantic-release",
|
|
3
3
|
"description": "Automated semver compliant package publishing",
|
|
4
|
-
"version": "15.13.
|
|
4
|
+
"version": "15.13.21",
|
|
5
5
|
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
|
|
6
6
|
"ava": {
|
|
7
7
|
"files": [
|
|
@@ -17,11 +17,6 @@
|
|
|
17
17
|
"bugs": {
|
|
18
18
|
"url": "https://github.com/semantic-release/semantic-release/issues"
|
|
19
19
|
},
|
|
20
|
-
"config": {
|
|
21
|
-
"commitizen": {
|
|
22
|
-
"path": "cz-conventional-changelog"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
20
|
"contributors": [
|
|
26
21
|
"Gregor Martynus (https://twitter.com/gr2m)",
|
|
27
22
|
"Pierre Vanduynslager (https://twitter.com/@pvdlg_)"
|
|
@@ -36,15 +31,15 @@
|
|
|
36
31
|
"cosmiconfig": "^5.0.1",
|
|
37
32
|
"debug": "^4.0.0",
|
|
38
33
|
"env-ci": "^4.0.0",
|
|
39
|
-
"execa": "^
|
|
34
|
+
"execa": "^1.0.0",
|
|
40
35
|
"figures": "^3.0.0",
|
|
41
36
|
"find-versions": "^3.0.0",
|
|
42
37
|
"get-stream": "^5.0.0",
|
|
43
38
|
"git-log-parser": "^1.2.0",
|
|
44
39
|
"hook-std": "^2.0.0",
|
|
45
|
-
"hosted-git-info": "^
|
|
46
|
-
"lodash": "^4.17.
|
|
47
|
-
"marked": "^0.
|
|
40
|
+
"hosted-git-info": "^3.0.0",
|
|
41
|
+
"lodash": "^4.17.15",
|
|
42
|
+
"marked": "^0.7.0",
|
|
48
43
|
"marked-terminal": "^3.2.0",
|
|
49
44
|
"p-locate": "^4.0.0",
|
|
50
45
|
"p-reduce": "^2.0.0",
|
|
@@ -56,10 +51,8 @@
|
|
|
56
51
|
},
|
|
57
52
|
"devDependencies": {
|
|
58
53
|
"ava": "^2.0.0",
|
|
59
|
-
"clear-module": "^
|
|
54
|
+
"clear-module": "^4.0.0",
|
|
60
55
|
"codecov": "^3.0.0",
|
|
61
|
-
"commitizen": "^3.0.0",
|
|
62
|
-
"cz-conventional-changelog": "^2.0.0",
|
|
63
56
|
"delay": "^4.0.0",
|
|
64
57
|
"dockerode": "^2.5.2",
|
|
65
58
|
"file-url": "^3.0.0",
|
|
@@ -125,7 +118,6 @@
|
|
|
125
118
|
"url": "git+https://github.com/semantic-release/semantic-release.git"
|
|
126
119
|
},
|
|
127
120
|
"scripts": {
|
|
128
|
-
"cm": "git-cz",
|
|
129
121
|
"codecov": "codecov -f coverage/coverage-final.json",
|
|
130
122
|
"lint": "xo",
|
|
131
123
|
"pretest": "npm run lint",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Plugin developer guide
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Shareable configurations list
|
|
2
|
-
|
|
3
|
-
## Official configurations
|
|
4
|
-
- [@semantic-release/apm-config](https://github.com/semantic-release/apm-config) - semantic-release shareable configuration for releasing atom packages
|
|
5
|
-
- [@semantic-release/gitlab-config](https://github.com/semantic-release/gitlab-config) - semantic-release shareable configuration for GitLab
|
|
6
|
-
|
|
7
|
-
## Community configurations
|
package/docs/recipes/README.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Recipes
|
|
2
|
-
|
|
3
|
-
## CI configurations
|
|
4
|
-
- [CircleCI 2.0 workflows](circleci-workflows.md)
|
|
5
|
-
- [Travis CI](travis.md)
|
|
6
|
-
- [GitLab CI](gitlab-ci.md)
|
|
7
|
-
|
|
8
|
-
## Git hosted services
|
|
9
|
-
- [Git authentication with SSH keys](git-auth-ssh-keys.md)
|
|
10
|
-
|
|
11
|
-
## Package managers and languages
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Getting started
|
|
2
|
-
|
|
3
|
-
In order to use **semantic-release** you must follow these steps:
|
|
4
|
-
- [Install](./installation.md#installation) **semantic-release** in your project
|
|
5
|
-
- Configure your Continuous Integration service to [run **semantic-release**](./ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded)
|
|
6
|
-
- Configure your Git repository and package manager repository [authentication](ci-configuration.md#authentication) in your Continuous Integration service
|
|
7
|
-
- Configure **semantic-release** [options and plugins](./configuration.md#configuration)
|
|
8
|
-
|
|
9
|
-
Alternatively those steps can be easily done with the [**semantic-release** interactive CLI](https://github.com/semantic-release/cli):
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g semantic-release-cli
|
|
13
|
-
|
|
14
|
-
cd your-module
|
|
15
|
-
semantic-release-cli setup
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-

|
|
19
|
-
|
|
20
|
-
See the [semantic-release-cli](https://github.com/semantic-release/cli#what-it-does) documentation for more details.
|
|
21
|
-
|
|
22
|
-
**Note**: only a limited number of options, CI services and plugins are currently supported by `semantic-release-cli`.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
|
|
3
|
-
## Local installation
|
|
4
|
-
|
|
5
|
-
For [Node modules projects](https://docs.npmjs.com/getting-started/creating-node-modules) we recommend installing **semantic-release** locally and running the `semantic-release` command with [npx](https://www.npmjs.com/package/npx):
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
$ npm install --save-dev semantic-release
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Then in the CI environment:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
$ npx semantic-release
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Note:** `npx` is a tool bundled with `npm@>=5.2.0`. It is used to conveniently find the semantic-release binary and to execute it. See [What is npx](../support/FAQ.md#what-is-npx) for more details.
|
|
18
|
-
|
|
19
|
-
## Global installation
|
|
20
|
-
|
|
21
|
-
For other type of projects we recommend installing **semantic-release** directly in the CI environment, also with [npx](https://www.npmjs.com/package/npx):
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
$ npx semantic-release
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**Note:** For a global installation, it's recommended to specify the major **semantic-release** version to install (for example with with `npx semantic-release@15`, or `npm install -g semantic-release@15`). This way your build will not automatically use the next major **semantic-release** release that could possibly break your build. You will have to upgrade manually when a new major version is released.
|
|
28
|
-
|
|
29
|
-
**Note:** `npx` is a tool bundled with `npm@>=5.2.0`. It is used to conveniently install the semantic-release binary and to execute it. See [What is npx](../support/FAQ.md#what-is-npx) for more details.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Shareable configurations
|
|
2
|
-
|
|
3
|
-
A shareable configuration is an [npm](https://www.npmjs.com/) package that exports a **semantic-release** configuration object. It allows for use of the same configuration across several projects.
|
|
4
|
-
|
|
5
|
-
The shareable configurations to use can be set with the [extends](configuration.md#extends) option.
|
|
6
|
-
|
|
7
|
-
See [shareable configurations list](../extending/shareable-configurations-list.md).
|