1 | module.exports = function (grunt) {
|
2 | grunt.initConfig({
|
3 | pkgFile: 'package.json',
|
4 | 'npm-contributors': {
|
5 | options: {
|
6 | commitMessage: 'chore: update contributors'
|
7 | }
|
8 | },
|
9 | bump: {
|
10 | options: {
|
11 | commitMessage: 'chore: release v%VERSION%',
|
12 | pushTo: 'upstream',
|
13 | commitFiles: [
|
14 | 'package.json',
|
15 | 'CHANGELOG.md'
|
16 | ]
|
17 | }
|
18 | },
|
19 | conventionalChangelog: {
|
20 | options: {
|
21 | changelogOpts: {
|
22 | preset: 'angular'
|
23 | }
|
24 | },
|
25 | release: {
|
26 | src: 'CHANGELOG.md'
|
27 | }
|
28 | }
|
29 | })
|
30 |
|
31 | require('load-grunt-tasks')(grunt)
|
32 |
|
33 | grunt.registerTask('default', [])
|
34 |
|
35 | grunt.registerTask('release', 'Bump the version and publish to NPM.', function (type) {
|
36 | grunt.task.run([
|
37 | 'npm-contributors',
|
38 | 'bump-only:' + (type || 'patch'),
|
39 | 'conventionalChangelog',
|
40 | 'bump-commit',
|
41 | 'npm-publish'
|
42 | ])
|
43 | })
|
44 | }
|