semantic-release 20.0.0-beta.3 → 20.0.0-beta.4
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 +4 -5
- package/bin/semantic-release.js +9 -9
- package/cli.js +31 -31
- package/docs/developer-guide/js-api.md +46 -37
- package/docs/developer-guide/plugin.md +97 -93
- package/docs/extending/plugins-list.md +8 -7
- package/docs/extending/shareable-configurations-list.md +2 -0
- package/docs/recipes/ci-configurations/README.md +1 -0
- package/docs/recipes/ci-configurations/github-actions.md +6 -3
- package/docs/recipes/ci-configurations/gitlab-ci.md +2 -3
- package/docs/recipes/git-hosted-services/README.md +1 -0
- package/docs/recipes/git-hosted-services/git-auth-ssh-keys.md +4 -1
- package/docs/recipes/release-workflow/README.md +1 -0
- package/docs/recipes/release-workflow/distribution-channels.md +1 -0
- package/docs/recipes/release-workflow/maintenance-releases.md +1 -0
- package/docs/recipes/release-workflow/pre-releases.md +1 -0
- package/docs/support/FAQ.md +25 -14
- package/docs/support/troubleshooting.md +1 -0
- package/docs/usage/ci-configuration.md +4 -3
- package/docs/usage/configuration.md +8 -2
- package/docs/usage/plugins.md +11 -5
- package/docs/usage/workflow-configuration.md +29 -17
- package/index.js +75 -72
- package/lib/get-commits.js +15 -9
- package/lib/get-config.js +38 -38
- package/lib/get-error.js +4 -4
- package/lib/get-git-auth-url.js +32 -32
- package/lib/get-last-release.js +8 -8
- package/lib/get-logger.js +10 -10
- package/lib/get-next-version.js +11 -11
- package/lib/get-release-to-add.js +17 -17
- package/lib/git.js +41 -41
- package/lib/hide-sensitive.js +6 -6
- package/lib/utils.js +12 -12
- package/lib/verify.js +14 -14
- package/package.json +6 -13
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Plugins list
|
|
2
2
|
|
|
3
3
|
## Official plugins
|
|
4
|
+
|
|
4
5
|
- [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer)
|
|
5
6
|
- **Note**: this is already part of semantic-release and does not have to be installed separately
|
|
6
7
|
- `analyzeCommits`: Determine the type of release by analyzing commits with [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)
|
|
@@ -111,10 +112,10 @@
|
|
|
111
112
|
- [semantic-release-rubygem](https://github.com/Gusto/semantic-release-rubygem)
|
|
112
113
|
- `verifyConditions`: Locate and validate a `.gemspec` file, locate and validate a `lib/**/version.rb` file, verify the presence of the `GEM_HOST_API_KEY` environment variable, and create a credentials file with the API key.
|
|
113
114
|
- `prepare`: Update the version in the `lib/**/version.rb` version file and [build](https://guides.rubygems.org/command-reference/#gem-build) the gem.
|
|
114
|
-
- `publish`: [Push the Ruby gem](https://guides.rubygems.org/command-reference/#gem-push) to the gem server.
|
|
115
|
+
- `publish`: [Push the Ruby gem](https://guides.rubygems.org/command-reference/#gem-push) to the gem server.
|
|
115
116
|
- [semantic-release-npm-deprecate-old-versions](https://github.com/ghusse/semantic-release-npm-deprecate-old-versions)
|
|
116
117
|
- `verifyConditions`: Validates configuration.
|
|
117
|
-
- `publish`: Deprecates old versions, based on the declaration of supported versions in the config.
|
|
118
|
+
- `publish`: Deprecates old versions, based on the declaration of supported versions in the config.
|
|
118
119
|
- [amanda-mitchell/semantic-release-npm-multiple](https://github.com/amanda-mitchell/semantic-release-npm-multiple)
|
|
119
120
|
- **Note**: this is a thin wrapper around the built-in npm plugin that can target multiple registries
|
|
120
121
|
- `verifyConditions`: Verify the presence and the validity of the npm authentication and release configuration for multiple registries
|
|
@@ -124,21 +125,21 @@
|
|
|
124
125
|
- `verifyConditions`: Verify the presence of a license file
|
|
125
126
|
- `prepare`: Update the license file based on its type
|
|
126
127
|
- [semantic-release-pypi](https://github.com/abichinger/semantic-release-pypi)
|
|
127
|
-
- `verifyConditions`: Verify the environment variable
|
|
128
|
-
- `prepare`: Update the version in
|
|
128
|
+
- `verifyConditions`: Verify the environment variable `PYPI_TOKEN` and installation of build tools
|
|
129
|
+
- `prepare`: Update the version in `setup.cfg` and create the distribution packages
|
|
129
130
|
- `publish`: Publish the python package to a repository (default: pypi)
|
|
130
131
|
- [semantic-release-helm](https://github.com/m1pl/semantic-release-helm)
|
|
131
132
|
- `verifyConditions`: Validate configuration and (if present) credentials
|
|
132
|
-
- `prepare`: Update version and appVersion in
|
|
133
|
+
- `prepare`: Update version and appVersion in `Chart.yaml`
|
|
133
134
|
- `publish`: Publish the chart to a registry (if configured)
|
|
134
135
|
- [semantic-release-codeartifact](https://github.com/ryansonshine/semantic-release-codeartifact)
|
|
135
136
|
- `verifyConditions`: Validate configuration, get AWS CodeArtifact authentication and repository, validate `publishConfig` or `.npmrc` (if they exist), then pass the configuration to the associated plugins.
|
|
136
137
|
- [semantic-release-telegram](https://github.com/pustovitDmytro/semantic-release-telegram)
|
|
137
|
-
- `verifyConditions`: Validate configuration and verify
|
|
138
|
+
- `verifyConditions`: Validate configuration and verify `TELEGRAM_BOT_ID` and `TELEGRAM_BOT_TOKEN`
|
|
138
139
|
- `success`: Publish a message about the successful release to a telegram chat
|
|
139
140
|
- `fail`: publish a message about failure to a telegram chat
|
|
140
141
|
- [semantic-release-heroku](https://github.com/pustovitDmytro/semantic-release-heroku)
|
|
141
|
-
- `verifyConditions`: Validate configuration and verify
|
|
142
|
+
- `verifyConditions`: Validate configuration and verify `HEROKU_API_KEY`
|
|
142
143
|
- `prepare`: Update the package.json version and create release tarball
|
|
143
144
|
- `publish`: Publish version to heroku
|
|
144
145
|
- [semantic-release-mattermost](https://github.com/ttrobisch/semantic-release-mattermost)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Shareable configurations list
|
|
2
2
|
|
|
3
3
|
## Official configurations
|
|
4
|
+
|
|
4
5
|
- [@semantic-release/apm-config](https://github.com/semantic-release/apm-config) - semantic-release shareable configuration for releasing atom packages
|
|
5
6
|
- [@semantic-release/gitlab-config](https://github.com/semantic-release/gitlab-config) - semantic-release shareable configuration for GitLab
|
|
6
7
|
|
|
7
8
|
## Community configurations
|
|
9
|
+
|
|
8
10
|
- [@jedmao/semantic-release-npm-github-config](https://github.com/jedmao/semantic-release-npm-github-config)
|
|
9
11
|
- 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
12
|
- Creates a tarball that gets uploaded with each [GitHub release](https://github.com/semantic-release/github).
|
|
@@ -35,7 +35,7 @@ jobs:
|
|
|
35
35
|
- name: Setup Node.js
|
|
36
36
|
uses: actions/setup-node@v2
|
|
37
37
|
with:
|
|
38
|
-
node-version:
|
|
38
|
+
node-version: "lts/*"
|
|
39
39
|
- name: Install dependencies
|
|
40
40
|
run: npm ci
|
|
41
41
|
- name: Release
|
|
@@ -64,9 +64,11 @@ If the risk is acceptable, some extra configuration is needed. The [actions/chec
|
|
|
64
64
|
## Trigger semantic-release on demand
|
|
65
65
|
|
|
66
66
|
### Using GUI:
|
|
67
|
+
|
|
67
68
|
You can use [Manual Triggers](https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/) for GitHub Actions.
|
|
68
69
|
|
|
69
70
|
### Using HTTP:
|
|
71
|
+
|
|
70
72
|
Use [`repository_dispatch`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch) event to have control on when to generate a release by making an HTTP request, e.g.:
|
|
71
73
|
|
|
72
74
|
```yaml
|
|
@@ -85,7 +87,8 @@ $ curl -v -H "Accept: application/vnd.github.everest-preview+json" -H "Authoriza
|
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
### Using 3rd party apps:
|
|
90
|
+
|
|
88
91
|
If you'd like to use a GitHub app to manage this instead of creating a personal access token, you could consider using a project like:
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
- [Actions Panel](https://www.actionspanel.app/) - A declaratively configured way for triggering GitHub Actions
|
|
94
|
+
- [Action Button](https://github-action-button.web.app/#details) - A simple badge based mechanism for triggering GitHub Actions
|
|
@@ -21,8 +21,8 @@ This example is a minimal configuration for **semantic-release** with a build ru
|
|
|
21
21
|
```yaml
|
|
22
22
|
# The release pipeline will run only if all jobs in the test pipeline are successful
|
|
23
23
|
stages:
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
- test
|
|
25
|
+
- release
|
|
26
26
|
|
|
27
27
|
before_script:
|
|
28
28
|
- npm install
|
|
@@ -52,7 +52,6 @@ This example is a minimal configuration for **semantic-release** with a build ru
|
|
|
52
52
|
|
|
53
53
|
**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.
|
|
54
54
|
|
|
55
|
-
|
|
56
55
|
```yaml
|
|
57
56
|
# The release pipeline will run only on the master branch a commit is triggered
|
|
58
57
|
stages:
|
|
@@ -21,6 +21,7 @@ This will generate a public key in `git_deploy_key.pub` and a private key in `gi
|
|
|
21
21
|
## Adding the SSH public key to the Git hosted account
|
|
22
22
|
|
|
23
23
|
Step by step instructions are provided for the following Git hosted services:
|
|
24
|
+
|
|
24
25
|
- [GitHub](#adding-the-ssh-public-key-to-github)
|
|
25
26
|
|
|
26
27
|
### Adding the SSH public key to GitHub
|
|
@@ -44,6 +45,7 @@ See [Adding a new SSH key to your GitHub account](https://help.github.com/articl
|
|
|
44
45
|
In order to be available on the CI environment, the SSH private key must be encrypted, committed to the Git repository and decrypted by the CI service.
|
|
45
46
|
|
|
46
47
|
Step by step instructions are provided for the following environments:
|
|
48
|
+
|
|
47
49
|
- [Travis CI](#adding-the-ssh-private-key-to-travis-ci)
|
|
48
50
|
- [Circle CI](#adding-the-ssh-private-key-to-circle-ci)
|
|
49
51
|
|
|
@@ -109,7 +111,7 @@ $ git push
|
|
|
109
111
|
|
|
110
112
|
### Adding the SSH private key to Circle CI
|
|
111
113
|
|
|
112
|
-
First we encrypt the `git_deploy_key` (private key) using a symmetric encryption (AES-256).
|
|
114
|
+
First we encrypt the `git_deploy_key` (private key) using a symmetric encryption (AES-256). Run the following `openssl` command and _make sure to note the output which we'll need later_:
|
|
113
115
|
|
|
114
116
|
```bash
|
|
115
117
|
$ openssl aes-256-cbc -e -p -in git_deploy_key -out git_deploy_key.enc -K `openssl rand -hex 32` -iv `openssl rand -hex 16`
|
|
@@ -119,6 +121,7 @@ iv =VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
|
|
|
119
121
|
```
|
|
120
122
|
|
|
121
123
|
Add the following [environment variables](https://circleci.com/docs/2.0/env-vars/#adding-environment-variables-in-the-app) to Circle CI:
|
|
124
|
+
|
|
122
125
|
- `SSL_PASSPHRASE` - the value set during the [SSH keys generation](#generating-the-ssh-keys) step.
|
|
123
126
|
- `REPO_ENC_KEY` - the `key` (KKK) value from the `openssl` step above.
|
|
124
127
|
- `REPO_ENC_IV` - the `iv` (VVV) value from the `openssl` step above.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
This recipe will walk you through a simple example that uses distribution channels to make releases available only to a subset of users, in order to collect feedback before distributing the release to all users.
|
|
4
4
|
|
|
5
5
|
This example uses the **semantic-release** default configuration:
|
|
6
|
+
|
|
6
7
|
- [branches](../../usage/configuration.md#branches): `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]`
|
|
7
8
|
- [plugins](../../usage/configuration.md#plugins): `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']`
|
|
8
9
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
This recipe will walk you through a simple example that uses Git branches and distribution channels to publish fixes and features for old versions of a package.
|
|
4
4
|
|
|
5
5
|
This example uses the **semantic-release** default configuration:
|
|
6
|
+
|
|
6
7
|
- [branches](../../usage/configuration.md#branches): `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]`
|
|
7
8
|
- [plugins](../../usage/configuration.md#plugins): `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']`
|
|
8
9
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
This recipe will walk you through a simple example that uses pre-releases to publish beta versions while working on a future major release and then make only one release on the default distribution.
|
|
4
4
|
|
|
5
5
|
This example uses the **semantic-release** default configuration:
|
|
6
|
+
|
|
6
7
|
- [branches](../../usage/configuration.md#branches): `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]`
|
|
7
8
|
- [plugins](../../usage/configuration.md#plugins): `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']`
|
|
8
9
|
|
package/docs/support/FAQ.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[`@semantic-release/npm`](https://github.com/semantic-release/npm) takes care of updating the `package.json`’s version before publishing to [npm](https://www.npmjs.com).
|
|
6
6
|
|
|
7
|
-
By default, only the published package will contain the version, which is the only place where it is
|
|
7
|
+
By default, only the published package will contain the version, which is the only place where it is _really_ required, but the updated `package.json` will not be pushed to the Git repository
|
|
8
8
|
|
|
9
9
|
However, the [`@semantic-release/git`](https://github.com/semantic-release/git) plugin can be used to push the updated `package.json` as well as other files to the Git repository.
|
|
10
10
|
|
|
@@ -17,19 +17,24 @@ The `package.json`’s version will be updated by the `semantic-release` command
|
|
|
17
17
|
As the [`@semantic-release/npm`](https://github.com/semantic-release/npm) plugin uses the [npm CLI](https://docs.npmjs.com/cli/npm) to update the `package.json` version and publish the package, all [npm hook scripts](https://docs.npmjs.com/misc/scripts#description) will be executed.
|
|
18
18
|
|
|
19
19
|
You can run your build script in:
|
|
20
|
+
|
|
20
21
|
- the `prepublishOnly` or `prepack` hook so it will be executed during the `publish` step of `@semantic-release/npm`
|
|
21
22
|
- the `postversion` hook so it will be executed during the `prepare` step of `@semantic-release/npm`, which allow for example to update files before committing them with the [`@semantic-release/git`](https://github.com/semantic-release/git) plugin
|
|
22
23
|
|
|
23
24
|
If using npm hook scripts is not possible, and alternative solution is to [`@semantic-release/exec`](https://github.com/semantic-release/exec) plugin to run your script in the `prepare` step:
|
|
25
|
+
|
|
24
26
|
```json
|
|
25
27
|
{
|
|
26
28
|
"plugins": [
|
|
27
29
|
"@semantic-release/commit-analyzer",
|
|
28
30
|
"@semantic-release/release-notes-generator",
|
|
29
31
|
"@semantic-release/npm",
|
|
30
|
-
[
|
|
31
|
-
"
|
|
32
|
-
|
|
32
|
+
[
|
|
33
|
+
"@semantic-release/exec",
|
|
34
|
+
{
|
|
35
|
+
"prepareCmd": "./my-build-script.sh ${nextRelease.version}"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
33
38
|
]
|
|
34
39
|
}
|
|
35
40
|
```
|
|
@@ -43,6 +48,7 @@ Yes with the [dry-run options](../usage/configuration.md#dryrun) which prints to
|
|
|
43
48
|
Yes, **semantic-release** is a Node CLI application, but it can be used to publish any type of packages.
|
|
44
49
|
|
|
45
50
|
To publish a non-Node package (without a `package.json`) you would need to:
|
|
51
|
+
|
|
46
52
|
- Use a [global](../usage/installation.md#global-installation) **semantic-release** installation
|
|
47
53
|
- Set **semantic-release** [options](../usage/configuration.md#options) via [CLI arguments or `.rc` file](../usage/configuration.md#configuration)
|
|
48
54
|
- Make sure your CI job executing the `semantic-release` command has access to a version of Node that [meets our version requirement](./node-version.md) to execute the `semantic-release` command
|
|
@@ -61,10 +67,13 @@ Here is a basic example to create [GitHub releases](https://help.github.com/arti
|
|
|
61
67
|
"@semantic-release/commit-analyzer",
|
|
62
68
|
"@semantic-release/release-notes-generator",
|
|
63
69
|
"@semantic-release/github",
|
|
64
|
-
[
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
[
|
|
71
|
+
"@semantic-release/exec",
|
|
72
|
+
{
|
|
73
|
+
"prepareCmd": "set-version ${nextRelease.version}",
|
|
74
|
+
"publishCmd": "publish-package"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
68
77
|
]
|
|
69
78
|
}
|
|
70
79
|
```
|
|
@@ -76,6 +85,7 @@ See the [package managers and languages recipes](../recipes/release-workflow/REA
|
|
|
76
85
|
## Can I use semantic-release with any CI service?
|
|
77
86
|
|
|
78
87
|
Yes, **semantic-release** can be used with any CI service, as long as it provides:
|
|
88
|
+
|
|
79
89
|
- A way to set [authentication](../usage/ci-configuration.md#authentication) via environment variables
|
|
80
90
|
- 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)
|
|
81
91
|
|
|
@@ -99,7 +109,7 @@ See the [GitLab CI recipes](../recipes/ci-configurations/gitlab-ci.md#using-sema
|
|
|
99
109
|
|
|
100
110
|
## Can I use semantic-release with any Git hosted environment?
|
|
101
111
|
|
|
102
|
-
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
|
|
112
|
+
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).
|
|
103
113
|
|
|
104
114
|
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.
|
|
105
115
|
|
|
@@ -112,6 +122,7 @@ See the [`@semantic-release/npm`](https://github.com/semantic-release/npm#semant
|
|
|
112
122
|
## How can I revert a release?
|
|
113
123
|
|
|
114
124
|
If you have introduced a breaking bug in a release you have 2 options:
|
|
125
|
+
|
|
115
126
|
- If you have a fix immediately ready, commit and push it (or merge it via a pull request) to the release branch
|
|
116
127
|
- Otherwise, [revert the commit](https://git-scm.com/docs/git-revert) that introduced the bug and push the revert commit (or merge it via a pull request) to the release branch
|
|
117
128
|
|
|
@@ -121,7 +132,7 @@ Depending on the package manager you are using, you might be able to un-publish
|
|
|
121
132
|
|
|
122
133
|
In any case **do not remove the Git tag associated with the buggy version**, otherwise **semantic-release** will later try to republish that version. Publishing a version after un-publishing is not supported by most package managers.
|
|
123
134
|
|
|
124
|
-
**Note**: If you are using the default [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) be aware that it uses a different revert commit format than the standard one created by [git revert](https://git-scm.com/docs/git-revert), contrary to what is [claimed in the
|
|
135
|
+
**Note**: If you are using the default [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) be aware that it uses a different revert commit format than the standard one created by [git revert](https://git-scm.com/docs/git-revert), contrary to what is [claimed in the convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#revert). Therefore, if you revert a commit with [`git revert`](https://git-scm.com/docs/git-revert), use the [`--edit` option](https://git-scm.com/docs/git-revert#git-revert---edit) to format the message according to the [Angular revert commit message format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#revert). See [conventional-changelog/conventional-changelog#348](https://github.com/conventional-changelog/conventional-changelog/issues/348) for more details.
|
|
125
136
|
|
|
126
137
|
## Can I use `.npmrc` options?
|
|
127
138
|
|
|
@@ -157,7 +168,7 @@ See [Artifactory - npm Registry](https://www.jfrog.com/confluence/display/RTF/Np
|
|
|
157
168
|
|
|
158
169
|
## Can I manually trigger the release of a specific version?
|
|
159
170
|
|
|
160
|
-
You can trigger a release by pushing to your Git repository. You deliberately cannot trigger a
|
|
171
|
+
You can trigger a release by pushing to your Git repository. You deliberately cannot trigger a _specific_ version release, because this is the whole point of semantic-release.
|
|
161
172
|
|
|
162
173
|
## Can I exclude commits from the analysis?
|
|
163
174
|
|
|
@@ -168,7 +179,7 @@ Yes, every commits that contains `[skip release]` or `[release skip]` in their m
|
|
|
168
179
|
By default **semantic-release** uses the [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) and triggers releases based on the following rules:
|
|
169
180
|
|
|
170
181
|
| Commit | Release type |
|
|
171
|
-
|
|
182
|
+
| --------------------------- | -------------------------- |
|
|
172
183
|
| Commit with breaking change | ~~Major~~ Breaking release |
|
|
173
184
|
| Commit with type `feat` | ~~Minor~~ Feature release |
|
|
174
185
|
| Commit with type `fix` | Patch release |
|
|
@@ -178,9 +189,9 @@ See the [`@semantic-release/npm`](https://github.com/semantic-release/npm#npm-co
|
|
|
178
189
|
|
|
179
190
|
This is fully customizable with the [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer) plugin's [`release-rules` option](https://github.com/semantic-release/commit-analyzer#release-rules).
|
|
180
191
|
|
|
181
|
-
## Is it
|
|
192
|
+
## Is it _really_ a good idea to release on every push?
|
|
182
193
|
|
|
183
|
-
It is indeed a great idea because it
|
|
194
|
+
It is indeed a great idea because it _forces_ you to follow best practices. If you don’t feel comfortable releasing every feature or fix on your `master` you might not treat your `master` branch as intended.
|
|
184
195
|
|
|
185
196
|
From [Understanding the GitHub Flow](https://guides.github.com/introduction/flow/index.html):
|
|
186
197
|
|
|
@@ -15,6 +15,7 @@ This is most likely related to a misconfiguration of the [npm registry authentic
|
|
|
15
15
|
It might also happen if the package name you are trying to publish already exists (in the case of npm, you may be trying to publish a new version of a package that is not yours, hence the permission error).
|
|
16
16
|
|
|
17
17
|
To verify if your package name is available you can use [npm-name-cli](https://github.com/sindresorhus/npm-name-cli):
|
|
18
|
+
|
|
18
19
|
```bash
|
|
19
20
|
$ npm install --global npm-name-cli
|
|
20
21
|
$ npm-name <package-name>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The `semantic-release` command must be executed only after all the tests in the CI build pass. If the build runs multiple jobs (for example to test on multiple Operating Systems or Node versions) the CI has to be configured to guarantee that the `semantic-release` command is executed only after all jobs are successful.
|
|
6
6
|
Here are a few examples of the CI services that can be used to achieve this:
|
|
7
|
+
|
|
7
8
|
- [Travis Build Stages](https://docs.travis-ci.com/user/build-stages)
|
|
8
9
|
- [CircleCI Workflows](https://circleci.com/docs/2.0/workflows)
|
|
9
10
|
- [GitHub Actions](https://github.com/features/actions)
|
|
@@ -22,11 +23,11 @@ See [CI configuration recipes](../recipes/ci-configurations#ci-configurations) f
|
|
|
22
23
|
**semantic-release** requires push access to the project Git repository in order to create [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging). The Git authentication can be set with one of the following environment variables:
|
|
23
24
|
|
|
24
25
|
| Variable | Description |
|
|
25
|
-
|
|
26
|
+
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
26
27
|
| `GH_TOKEN` or `GITHUB_TOKEN` | A GitHub [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line). |
|
|
27
28
|
| `GL_TOKEN` or `GITLAB_TOKEN` | A GitLab [personal access token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html). |
|
|
28
29
|
| `BB_TOKEN` or `BITBUCKET_TOKEN` | A Bitbucket [personal access token](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html). |
|
|
29
|
-
| `BB_TOKEN_BASIC_AUTH` or `BITBUCKET_TOKEN_BASIC_AUTH` | A Bitbucket [personal access token](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html) with basic auth support. For clarification `user:token` has to be the value of this env.
|
|
30
|
+
| `BB_TOKEN_BASIC_AUTH` or `BITBUCKET_TOKEN_BASIC_AUTH` | A Bitbucket [personal access token](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html) with basic auth support. For clarification `user:token` has to be the value of this env. |
|
|
30
31
|
| `GIT_CREDENTIALS` | [URL encoded](https://en.wikipedia.org/wiki/Percent-encoding) Git username and password in the format `<username>:<password>`. The username and password must each be individually URL encoded, not the `:` separating them. |
|
|
31
32
|
|
|
32
33
|
Alternatively the Git authentication can be set up via [SSH keys](../recipes/git-hosted-services/git-auth-ssh-keys.md).
|
|
@@ -36,7 +37,7 @@ Alternatively the Git authentication can be set up via [SSH keys](../recipes/git
|
|
|
36
37
|
Most **semantic-release** [plugins](plugins.md) require setting up authentication in order to publish to a package manager registry. The default [@semantic-release/npm](https://github.com/semantic-release/npm#environment-variables) and [@semantic-release/github](https://github.com/semantic-release/github#environment-variables) plugins require the following environment variables:
|
|
37
38
|
|
|
38
39
|
| Variable | Description |
|
|
39
|
-
|
|
40
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
40
41
|
| `NPM_TOKEN` | npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens).<br/>**Note**: Only the `auth-only` [level of npm two-factor authentication](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) is supported. |
|
|
41
42
|
| `GH_TOKEN` | GitHub authentication token.<br/>**Note**: Only the [personal token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) authentication is supported. |
|
|
42
43
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Configuration
|
|
2
2
|
|
|
3
3
|
**semantic-release** configuration consists of:
|
|
4
|
+
|
|
4
5
|
- Git repository ([URL](#repositoryurl) and options [release branches](#branches) and [tag format](#tagformat))
|
|
5
6
|
- Plugins [declaration](#plugins) and options
|
|
6
7
|
- Run mode ([debug](#debug), [dry run](#dryrun) and [local (no CI)](#ci))
|
|
@@ -12,6 +13,7 @@ Additionally, metadata of Git tags generated by **semantic-release** can be cust
|
|
|
12
13
|
## Configuration file
|
|
13
14
|
|
|
14
15
|
**semantic-release**’s [options](#options), mode and [plugins](plugins.md) can be set via either:
|
|
16
|
+
|
|
15
17
|
- A `.releaserc` file, written in YAML or JSON, with optional extensions: `.yaml`/`.yml`/`.json`/`.js`/`.cjs`
|
|
16
18
|
- A `release.config.(js|cjs)` file that exports an object
|
|
17
19
|
- A `release` key in the project's `package.json` file
|
|
@@ -21,6 +23,7 @@ Alternatively, some options can be set via CLI arguments.
|
|
|
21
23
|
The following three examples are the same.
|
|
22
24
|
|
|
23
25
|
- Via `release` key in the project's `package.json` file:
|
|
26
|
+
|
|
24
27
|
```json
|
|
25
28
|
{
|
|
26
29
|
"release": {
|
|
@@ -30,6 +33,7 @@ The following three examples are the same.
|
|
|
30
33
|
```
|
|
31
34
|
|
|
32
35
|
- Via `.releaserc` file:
|
|
36
|
+
|
|
33
37
|
```json
|
|
34
38
|
{
|
|
35
39
|
"branches": ["master", "next"]
|
|
@@ -37,6 +41,7 @@ The following three examples are the same.
|
|
|
37
41
|
```
|
|
38
42
|
|
|
39
43
|
- Via CLI argument:
|
|
44
|
+
|
|
40
45
|
```bash
|
|
41
46
|
$ semantic-release --branches next
|
|
42
47
|
```
|
|
@@ -65,10 +70,11 @@ Default: `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name:
|
|
|
65
70
|
CLI arguments: `--branches`
|
|
66
71
|
|
|
67
72
|
The branches on which releases should happen. By default **semantic-release** will release:
|
|
73
|
+
|
|
68
74
|
- regular releases to the default distribution channel from the branch `master`
|
|
69
75
|
- regular releases to a distribution channel matching the branch name from any existing branch with a name matching a maintenance release range (`N.N.x` or `N.x.x` or `N.x` with `N` being a number)
|
|
70
76
|
- regular releases to the `next` distribution channel from the branch `next` if it exists
|
|
71
|
-
- regular releases
|
|
77
|
+
- regular releases to the `next-major` distribution channel from the branch `next-major` if it exists
|
|
72
78
|
- pre-releases to the `beta` distribution channel from the branch `beta` if it exists
|
|
73
79
|
- pre-releases to the `alpha` distribution channel from the branch `alpha` if it exists
|
|
74
80
|
|
|
@@ -143,7 +149,7 @@ Output debugging information. This can also be enabled by setting the `DEBUG` en
|
|
|
143
149
|
## Git environment variables
|
|
144
150
|
|
|
145
151
|
| Variable | Description | Default |
|
|
146
|
-
|
|
152
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ |
|
|
147
153
|
| `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. |
|
|
148
154
|
| `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. |
|
|
149
155
|
| `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. |
|
package/docs/usage/plugins.md
CHANGED
|
@@ -5,7 +5,7 @@ Each [release step](../../README.md#release-steps) is implemented by configurabl
|
|
|
5
5
|
A plugin is a npm module that can implement one or more of the following steps:
|
|
6
6
|
|
|
7
7
|
| Step | Required | Description |
|
|
8
|
-
|
|
8
|
+
| ------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
9
|
| `verifyConditions` | No | Responsible for verifying conditions necessary to proceed with the release: configuration is correct, authentication token are valid, etc... |
|
|
10
10
|
| `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. |
|
|
11
11
|
| `verifyRelease` | No | Responsible for verifying the parameters (version, type, dist-tag etc...) of the release that is about to be published. |
|
|
@@ -25,6 +25,7 @@ Release steps will run in that order. At each step, **semantic-release** will ru
|
|
|
25
25
|
### Default plugins
|
|
26
26
|
|
|
27
27
|
These four plugins are already part of **semantic-release** and are listed in order of execution. They do not have to be installed separately:
|
|
28
|
+
|
|
28
29
|
```
|
|
29
30
|
"@semantic-release/commit-analyzer"
|
|
30
31
|
"@semantic-release/release-notes-generator"
|
|
@@ -66,13 +67,14 @@ For each [release step](../../README.md#release-steps) the plugins that implemen
|
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
With this configuration **semantic-release** will:
|
|
70
|
+
|
|
69
71
|
- execute the `verifyConditions` implementation of `@semantic-release/npm` then `@semantic-release/git`
|
|
70
72
|
- execute the `analyzeCommits` implementation of `@semantic-release/commit-analyzer`
|
|
71
73
|
- execute the `generateNotes` implementation of `@semantic-release/release-notes-generator`
|
|
72
74
|
- execute the `prepare` implementation of `@semantic-release/npm` then `@semantic-release/git`
|
|
73
75
|
- execute the `publish` implementation of `@semantic-release/npm`
|
|
74
76
|
|
|
75
|
-
Order is first determined by release steps (such as `verifyConditions` → `
|
|
77
|
+
Order is first determined by release steps (such as `verifyConditions` → `analyzeCommits`). At each release step, plugins are executed in the order in which they are defined.
|
|
76
78
|
|
|
77
79
|
## Plugin options configuration
|
|
78
80
|
|
|
@@ -85,9 +87,12 @@ Global plugin configuration can be defined at the root of the **semantic-release
|
|
|
85
87
|
"plugins": [
|
|
86
88
|
"@semantic-release/commit-analyzer",
|
|
87
89
|
"@semantic-release/release-notes-generator",
|
|
88
|
-
[
|
|
89
|
-
"
|
|
90
|
-
|
|
90
|
+
[
|
|
91
|
+
"@semantic-release/github",
|
|
92
|
+
{
|
|
93
|
+
"assets": ["dist/**"]
|
|
94
|
+
}
|
|
95
|
+
],
|
|
91
96
|
"@semantic-release/git"
|
|
92
97
|
],
|
|
93
98
|
"preset": "angular"
|
|
@@ -95,5 +100,6 @@ Global plugin configuration can be defined at the root of the **semantic-release
|
|
|
95
100
|
```
|
|
96
101
|
|
|
97
102
|
With this configuration:
|
|
103
|
+
|
|
98
104
|
- 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`)
|
|
99
105
|
- 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)
|