@govbr-ds/release-config 1.0.0 → 1.1.0-alpha.1
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 +34 -3
- package/package.json +4 -5
- package/shared.config.js +133 -0
- package/release.config.js +0 -194
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Nessa configuração nós usamos os seguintes plugins:
|
|
|
16
16
|
|
|
17
17
|
- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer)
|
|
18
18
|
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator)
|
|
19
|
+
- [`@semantic-release/npm`](https://github.com/semantic-release/npm)
|
|
19
20
|
- [`@semantic-release/changelog`](https://github.com/semantic-release/changelog)
|
|
20
21
|
- [`@semantic-release/gitlab`](https://github.com/semantic-release/gitlab)
|
|
21
22
|
|
|
@@ -23,9 +24,39 @@ Nessa configuração nós usamos os seguintes plugins:
|
|
|
23
24
|
|
|
24
25
|
A configuração compartilhada pode ser configurada conforme o [arquivo de configuração do semantic-release](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
### Exemplo
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
const sharedConfig = require('@govbr-ds/release-config')
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
branches: [...sharedConfig.branches],
|
|
34
|
+
plugins: [
|
|
35
|
+
sharedConfig.plugins.commitAnalyzer,
|
|
36
|
+
sharedConfig.plugins.releaseNotes,
|
|
37
|
+
// Configuração sobrescrita
|
|
38
|
+
[
|
|
39
|
+
'@semantic-release/changelog',
|
|
40
|
+
{
|
|
41
|
+
changelogTitle: '# CHANGELOG',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
sharedConfig.plugins.gitlab,
|
|
45
|
+
sharedConfig.plugins.npm,
|
|
46
|
+
sharedConfig.plugins.git,
|
|
47
|
+
// Plugin não configurado no padrão (consulte a documentação do plugin para mais detalhes)
|
|
48
|
+
[
|
|
49
|
+
'semantic-release-discord',
|
|
50
|
+
{
|
|
51
|
+
onSuccessTemplate: {
|
|
52
|
+
username: 'Username',
|
|
53
|
+
content:
|
|
54
|
+
"A versão v$npm_package_version do projeto LOREM IPSUM já está disponível!",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
],
|
|
59
|
+
}
|
|
29
60
|
```
|
|
30
61
|
|
|
31
62
|
### Configuração
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@govbr-ds/release-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-alpha.1",
|
|
4
4
|
"description": "Configuração compartilhada do semantic-release para projetos do GOVBR-DS no gitlab",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gitlab",
|
|
@@ -19,14 +19,13 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"author": "SERPRO <govbr-ds@serpro.gov.br> (http://serpro.gov.br/)",
|
|
22
|
-
"main": "
|
|
22
|
+
"main": "shared.config.js",
|
|
23
23
|
"files": [
|
|
24
|
-
"
|
|
24
|
+
"shared.config.js"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
27
|
"commit": "git-cz",
|
|
28
|
-
"prepare": "husky install"
|
|
29
|
-
"semantic-release": "semantic-release"
|
|
28
|
+
"prepare": "husky install"
|
|
30
29
|
},
|
|
31
30
|
"config": {
|
|
32
31
|
"commitizen": {
|
package/shared.config.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arquivo com as configurações compartilhadas entre os projetos.
|
|
3
|
+
* Cada projeto deve importar essa configuração e usar conforme o README.md
|
|
4
|
+
*/
|
|
5
|
+
module.exports = {
|
|
6
|
+
branches: [
|
|
7
|
+
'main',
|
|
8
|
+
'+([0-9])?(.{+([0-9]),x}).x',
|
|
9
|
+
'next',
|
|
10
|
+
'next-major',
|
|
11
|
+
{
|
|
12
|
+
name: '+([0-9])?(.{+([0-9]),x}).x-rc',
|
|
13
|
+
prerelease: 'rc',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: '+([0-9])?(.{+([0-9]),x}).x-beta',
|
|
17
|
+
prerelease: 'beta',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: '+([0-9])?(.{+([0-9]),x}).x-alpha',
|
|
21
|
+
prerelease: 'alpha',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'rc',
|
|
25
|
+
prerelease: 'rc',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'beta',
|
|
29
|
+
prerelease: 'beta',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'alpha',
|
|
33
|
+
prerelease: 'alpha',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
/**
|
|
37
|
+
* As configurações de cada plugin não podem ser sobrescritas.
|
|
38
|
+
* Devem ser usadas por inteiro.
|
|
39
|
+
*/
|
|
40
|
+
plugins: {
|
|
41
|
+
commitAnalyzer: [
|
|
42
|
+
'@semantic-release/commit-analyzer',
|
|
43
|
+
{
|
|
44
|
+
preset: 'conventionalcommits',
|
|
45
|
+
releaseRules: [
|
|
46
|
+
// breaking precisa estar no topo devido a como o plugin se comporta: https://github.com/semantic-release/commit-analyzer#releaserules
|
|
47
|
+
{ breaking: true, release: 'major' },
|
|
48
|
+
{ type: 'build', release: false },
|
|
49
|
+
{ type: 'chore', release: false },
|
|
50
|
+
{ type: 'ci', release: false },
|
|
51
|
+
{ type: 'deprecated', release: false },
|
|
52
|
+
{ type: 'docs', release: 'patch' },
|
|
53
|
+
{ type: 'feat', release: 'minor' },
|
|
54
|
+
{ type: 'fix', release: 'patch' },
|
|
55
|
+
{ type: 'perf', release: 'patch' },
|
|
56
|
+
{ type: 'refactor', release: 'patch' },
|
|
57
|
+
{ type: 'removed', release: 'patch' },
|
|
58
|
+
{ type: 'revert', release: 'minor' },
|
|
59
|
+
{ type: 'style', release: false },
|
|
60
|
+
{ type: 'test', release: false },
|
|
61
|
+
{ type: 'wip', release: false },
|
|
62
|
+
{ scope: 'no-release', release: false },
|
|
63
|
+
],
|
|
64
|
+
parserOpts: {
|
|
65
|
+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
releaseNotes: [
|
|
70
|
+
'@semantic-release/release-notes-generator',
|
|
71
|
+
{
|
|
72
|
+
preset: 'conventionalcommits',
|
|
73
|
+
presetConfig: {
|
|
74
|
+
header: '# CHANGELOG',
|
|
75
|
+
// O release notes/changelog vai ser gerado nessa ordem
|
|
76
|
+
types: [
|
|
77
|
+
{ type: 'breaking', section: ':boom: Breaking Changes' },
|
|
78
|
+
{ type: 'deprecated', section: ':wastebasket: Depreciado' },
|
|
79
|
+
{ type: 'feat', section: ':new: Novidades' },
|
|
80
|
+
{ type: 'removed', section: ':fire: Removido' },
|
|
81
|
+
{ type: 'docs', section: ':memo: Documentação' },
|
|
82
|
+
{ type: 'fix', section: ':bug: Correções' },
|
|
83
|
+
{ type: 'perf', section: ':zap: Performance' },
|
|
84
|
+
{ type: 'refactor', section: ':recycle: Refatorado' },
|
|
85
|
+
{ type: 'revert', section: ':rewind: Revertido/Rollback' },
|
|
86
|
+
{ type: 'build', hidden: true },
|
|
87
|
+
{ type: 'chore', hidden: true },
|
|
88
|
+
{ type: 'ci', hidden: true },
|
|
89
|
+
{ type: 'style', hidden: true },
|
|
90
|
+
{ type: 'test', hidden: true },
|
|
91
|
+
{ type: 'wip', hidden: true },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
parserOpts: {
|
|
95
|
+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
|
|
96
|
+
},
|
|
97
|
+
writerOpts: {
|
|
98
|
+
commitsSort: ['subject', 'scope'],
|
|
99
|
+
finalizeContext: (context) => {
|
|
100
|
+
const date = new Date()
|
|
101
|
+
const day = date.getDate()
|
|
102
|
+
const month = date.getMonth() + 1
|
|
103
|
+
const year = date.getFullYear()
|
|
104
|
+
context.date = `${day}/${month}/${year}`
|
|
105
|
+
return context
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
changelog: [
|
|
111
|
+
'@semantic-release/changelog',
|
|
112
|
+
{
|
|
113
|
+
changelogTitle: '# CHANGELOG',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
gitlab: [
|
|
117
|
+
'@semantic-release/gitlab',
|
|
118
|
+
{
|
|
119
|
+
successComment:
|
|
120
|
+
':tada: Essa issue foi resolvida na versão ${nextRelease.version} :tada:\n\nPara mais detalhes:\n- [GitLab release](${CI_PROJECT_URL}/-/releases/${nextRelease.version})\n- [GitLab tag](${CI_PROJECT_URL}/-/tags/${nextRelease.version})',
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
npm: ['@semantic-release/npm'],
|
|
124
|
+
git: [
|
|
125
|
+
'@semantic-release/git',
|
|
126
|
+
{
|
|
127
|
+
assets: ['package.json', 'CHANGELOG.md'],
|
|
128
|
+
message:
|
|
129
|
+
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
}
|
package/release.config.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
branches: [
|
|
3
|
-
'main',
|
|
4
|
-
'+([0-9])?(.{+([0-9]),x}).x',
|
|
5
|
-
'next',
|
|
6
|
-
'next-major',
|
|
7
|
-
{
|
|
8
|
-
name: '+([0-9])?(.{+([0-9]),x}).x-rc',
|
|
9
|
-
prerelease: 'rc',
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: '+([0-9])?(.{+([0-9]),x}).x-beta',
|
|
13
|
-
prerelease: 'beta',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: '+([0-9])?(.{+([0-9]),x}).x-alpha',
|
|
17
|
-
prerelease: 'alpha',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'rc',
|
|
21
|
-
prerelease: 'rc',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'beta',
|
|
25
|
-
prerelease: 'beta',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'alpha',
|
|
29
|
-
prerelease: 'alpha',
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
plugins: [
|
|
33
|
-
[
|
|
34
|
-
'@semantic-release/commit-analyzer',
|
|
35
|
-
{
|
|
36
|
-
preset: 'conventionalcommits',
|
|
37
|
-
releaseRules: [
|
|
38
|
-
{
|
|
39
|
-
type: 'build',
|
|
40
|
-
release: false,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: 'chore',
|
|
44
|
-
release: false,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
type: 'ci',
|
|
48
|
-
release: false,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: 'deprecated',
|
|
52
|
-
release: false,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: 'docs',
|
|
56
|
-
release: 'patch',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: 'feat',
|
|
60
|
-
release: 'minor',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
type: 'fix',
|
|
64
|
-
release: 'patch',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: 'perf',
|
|
68
|
-
release: 'patch',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
type: 'refactor',
|
|
72
|
-
release: 'patch',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
type: 'removed',
|
|
76
|
-
release: 'minor',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
type: 'revert',
|
|
80
|
-
release: 'minor',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
type: 'style',
|
|
84
|
-
release: false,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
type: 'test',
|
|
88
|
-
release: false,
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
type: 'wip',
|
|
92
|
-
release: false,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
scope: 'no-release',
|
|
96
|
-
release: false,
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
[
|
|
102
|
-
'@semantic-release/release-notes-generator',
|
|
103
|
-
{
|
|
104
|
-
preset: 'conventionalcommits',
|
|
105
|
-
parserOpts: {
|
|
106
|
-
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
|
|
107
|
-
types: [
|
|
108
|
-
{
|
|
109
|
-
type: 'build',
|
|
110
|
-
hidden: true,
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
type: 'chore',
|
|
114
|
-
hidden: true,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
type: 'ci',
|
|
118
|
-
hidden: true,
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
type: 'deprecated',
|
|
122
|
-
section: 'Depreciado/Obsoleto',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
type: 'docs',
|
|
126
|
-
section: 'Documentação',
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
type: 'feat',
|
|
130
|
-
section: 'Novidades',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
type: 'fix',
|
|
134
|
-
section: 'Correções',
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
type: 'perf',
|
|
138
|
-
section: 'Performance',
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
type: 'refactor',
|
|
142
|
-
section: 'Refatorado',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
type: 'removed',
|
|
146
|
-
section: 'Removido',
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
type: 'revert',
|
|
150
|
-
section: 'Revertido/Rollback',
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
type: 'style',
|
|
154
|
-
hidden: true,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
type: 'test',
|
|
158
|
-
hidden: true,
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
type: 'wip',
|
|
162
|
-
hidden: true,
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
},
|
|
166
|
-
writerOpts: {
|
|
167
|
-
commitsSort: ['subject', 'scope'],
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
],
|
|
171
|
-
[
|
|
172
|
-
'@semantic-release/changelog',
|
|
173
|
-
{
|
|
174
|
-
changelogTitle: '# CHANGELOG',
|
|
175
|
-
},
|
|
176
|
-
],
|
|
177
|
-
[
|
|
178
|
-
'@semantic-release/gitlab',
|
|
179
|
-
{
|
|
180
|
-
successComment:
|
|
181
|
-
':tada: Essa issue foi resolvida na versão ${nextRelease.version} :tada:\n\nPara mais detalhes:\n- [GitLab release](${CI_PROJECT_URL}/-/releases/${nextRelease.version})\n- [GitLab tag](${CI_PROJECT_URL}/-/tags/${nextRelease.version})',
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
'@semantic-release/npm',
|
|
185
|
-
[
|
|
186
|
-
'@semantic-release/git',
|
|
187
|
-
{
|
|
188
|
-
assets: ['package.json', 'CHANGELOG.md'],
|
|
189
|
-
message:
|
|
190
|
-
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
|
|
191
|
-
},
|
|
192
|
-
],
|
|
193
|
-
],
|
|
194
|
-
}
|