-
Notifications
You must be signed in to change notification settings - Fork 22
/
release.config.js
67 lines (67 loc) · 2.66 KB
/
release.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* eslint-disable import/no-commonjs */
/* eslint-disable no-template-curly-in-string */
/**
* We use semantic-release to automate the publishing of new versions based on
* the commit history: whenever a commit is pushed to the master branch, it
* checks if any commit had a BREAKING CHANGE / feat() / fix() message, and
* publishes (or not) a new major.minor/patch version accordingly.
*
* See: https://github.com/semantic-release/semantic-release.
*
* Semantic-release executes steps in order (from verifyConditions to
* success/fail). For each step, it execute the matching code in each plugin (if
* such exists). If any step fails, the whole process stop.
*
* As we are using a mix of core and community plugins, as well as slightly
* diverging from the default use-case, we explictly define the order of plugins
* in each step instead of relying on the default order.
*
* The current configuration will:
* - Check if a new version needs to be published (and stop if not)
* - Update the version number in package.json accordingly
* - Update the CHANGELOG.md with the changes
* - Create a new commit, and tag it with the version number
* - Publish the code source to GitHub Releases (not very useful).
*
* Specifically, it does not:
* - Publish the code to npm (this is not an npm module)
* - Publish the Docker image (yarn publish:docker takes care of that).
**/
module.exports = {
branches: 'master',
plugins: [
// Those 4 plugins are part of the core of semantic-release
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/npm',
'@semantic-release/github',
// Those 2 are additional plugins
'@semantic-release/changelog',
'@semantic-release/git',
],
// Below are the various steps
// Source: https://semantic-release.gitbook.io/semantic-release/usage/plugins
// We explicitly define because it allows us to:
// - remove steps that we don't need (for example verifying npm credentials as
// we don't publish on npm)
// - put steps in order (for example updating the changelog file before
// committing it)
verifyConditions: ['@semantic-release/github', '@semantic-release/git'],
analyzeCommits: ['@semantic-release/commit-analyzer'],
verifyRelease: [],
generateNotes: ['@semantic-release/release-notes-generator'],
prepare: [
'@semantic-release/changelog',
'@semantic-release/npm',
{
path: '@semantic-release/git',
assets: ['package.json', 'CHANGELOG.md'],
message:
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
publish: ['@semantic-release/github'],
addChannel: [],
success: [],
fail: [],
};