-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
139 lines (138 loc) · 3.63 KB
/
Gruntfile.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/**
* Gruntfile for release candidates.
*
* @author Justin Hartman <code@justhart.com>
* @copyright Copyright (c) 2022 Justin Hartman <https://justhart.com>
* @version 1.1.0
*/
module.exports = (grunt) => {
grunt.loadNpmTasks('git-changelog');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-git');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bump: {
options: {
files: ['package.json', 'app.json'],
updateConfigs: ['pkg', 'git_changelog'],
commit: false,
createTag: false,
push: false,
globalReplace: true,
prereleaseName: false,
metadata: '',
regExp: false,
},
},
git_changelog: {
main: {
options: {
app_name: 'FIFA+ Play Zone Changelog',
intro: 'This file contains the changelog details for revisions to the FIFA+ Play Zone.',
branch: 'main',
repo_url: 'https://github.com/justinhartman/fifa-play-zone',
file: 'docs/tags/<%= pkg.version %>.md',
template: 'docs/tags/templates/log_template.md',
commit_template: 'docs/tags/templates/log_commit_template.md',
sections: [
{
title: 'Breaking Changes',
grep: '^break',
},
{
title: 'New Features',
grep: '^feat',
},
{
title: 'Bug Fixes',
grep: '^fix',
},
{
title: 'Refactored Code',
grep: '^refactor',
},
{
title: 'Style Changes',
grep: '^style',
},
{
title: 'Core Updates',
grep: '^chore',
},
{
title: 'Testing',
grep: '^test',
},
{
title: 'Documentation',
grep: '^docs',
},
{
title: 'StyleCI Fixes',
grep: '^Apply fixes from',
},
{
title: 'Composer Updates',
grep: '^composer',
},
{
title: 'Node Package Updates',
grep: '^npm',
},
{
title: 'Branches Merged',
grep: '^Merge branch',
},
{
title: 'Pull Requests Merged',
grep: '^Merge pull request',
},
],
},
},
},
gitadd: {
task: {
files: {
src: [
'docs',
'app.json',
'package.json',
'yarn.lock',
'README.md',
],
},
},
},
gitcommit: {
your_target: {
options: {
message: 'chore: Tag Version <%= pkg.version %>',
description: 'Add files for tag <%= pkg.version %>.',
},
},
},
gittag: {
addtag: {
options: {
tag: '<%= pkg.version %>',
message: 'chore(release): Release Version <%= pkg.version %>',
},
},
},
gitpush: {
your_target: {
options: {
remote: 'origin',
branch: 'main',
tags: true,
},
},
},
});
grunt.registerTask('bump-changelog', ['bump', 'git_changelog']);
grunt.registerTask('publish', ['gitadd', 'gitcommit', 'gittag', 'gitpush']);
grunt.registerTask('minor', ['bump:minor', 'git_changelog', 'publish']);
grunt.registerTask('major', ['bump:major', 'git_changelog', 'publish']);
grunt.registerTask('default', ['bump', 'git_changelog', 'publish']);
};