fix(release): add tasks "grunt version" and "grunt version:patch" to create release tags
This commit is contained in:
Родитель
152b7f81c3
Коммит
532f8c2a53
38
Gruntfile.js
38
Gruntfile.js
|
@ -5,43 +5,9 @@
|
|||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.loadNpmTasks('grunt-copyright')
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint')
|
||||
grunt.loadNpmTasks('grunt-nsp-shrinkwrap')
|
||||
require('load-grunt-tasks')(grunt);
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
|
||||
copyright: {
|
||||
app: {
|
||||
options: {
|
||||
pattern: 'This Source Code Form is subject to the terms of the Mozilla Public'
|
||||
},
|
||||
src: [
|
||||
'{,config/}*.js',
|
||||
'{bans/,bin/,scripts/,test/}*'
|
||||
]
|
||||
},
|
||||
tests: {
|
||||
options: {
|
||||
pattern: 'Any copyright is dedicated to the Public Domain.'
|
||||
},
|
||||
src: [
|
||||
'test/{remote,local}/*.js'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc',
|
||||
reporter: require('jshint-stylish')
|
||||
},
|
||||
app: [
|
||||
'{,bans/,bin/,config/,scripts/,test/}*.js'
|
||||
]
|
||||
}
|
||||
})
|
||||
grunt.loadTasks('grunttasks')
|
||||
|
||||
grunt.registerTask('default', ['lint', 'copyright', 'validate-shrinkwrap'])
|
||||
grunt.registerTask('lint', ['jshint'])
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// takes care of bumping the version number in package.json
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.config('bump', {
|
||||
options: {
|
||||
files: ['package.json', 'npm-shrinkwrap.json'],
|
||||
bumpVersion: true,
|
||||
commit: true,
|
||||
commitMessage: 'Release v%VERSION%',
|
||||
commitFiles: ['package.json', 'npm-shrinkwrap.json', 'CHANGELOG'],
|
||||
createTag: true,
|
||||
tagName: 'v%VERSION%',
|
||||
tagMessage: 'Version %VERSION%',
|
||||
push: false,
|
||||
pushTo: 'origin',
|
||||
gitDescribeOptions: '--tags --always --abrev=1 --dirty=-d'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.config('copyright', {
|
||||
app: {
|
||||
options: {
|
||||
pattern: 'This Source Code Form is subject to the terms of the Mozilla Public'
|
||||
},
|
||||
src: [
|
||||
'{,config/}*.js',
|
||||
'{,bans/,bin/,grunttasks/,scripts/,test/}*.js'
|
||||
]
|
||||
},
|
||||
tests: {
|
||||
options: {
|
||||
pattern: 'Any copyright is dedicated to the Public Domain.'
|
||||
},
|
||||
src: [
|
||||
'test/{remote,local}/*.js'
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.config('jshint', {
|
||||
files: [
|
||||
'{,bans/,bin/,config/,grunttasks/,scripts/,test/**/}*.js'
|
||||
],
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
}
|
||||
})
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//
|
||||
// A task to stamp a new version.
|
||||
//
|
||||
// Before running this task you should update CHANGELOG with the
|
||||
// changes for this release. Protip: you only need to make changes
|
||||
// to CHANGELOG; this task will add and commit for you.
|
||||
//
|
||||
// * version is updated in package.json
|
||||
// * git tag with version name is created.
|
||||
// * git commit with updated package.json created.
|
||||
//
|
||||
// NOTE: This task will not push this commit for you.
|
||||
//
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.registerTask('version', [
|
||||
'bump-only:minor',
|
||||
'bump-commit'
|
||||
]);
|
||||
|
||||
grunt.registerTask('version:patch', [
|
||||
'bump-only:patch',
|
||||
'bump-commit'
|
||||
]);
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "fxa-customs-server",
|
||||
"version": "0.5.0",
|
||||
"version": "0.33.0",
|
||||
"dependencies": {
|
||||
"ass": {
|
||||
"version": "0.0.4",
|
||||
|
|
|
@ -28,12 +28,14 @@
|
|||
"devDependencies": {
|
||||
"ass": "0.0.4",
|
||||
"grunt": "0.4.5",
|
||||
"grunt-bump": "0.3.0",
|
||||
"grunt-cli": "0.1.13",
|
||||
"grunt-contrib-jshint": "0.10.0",
|
||||
"grunt-copyright": "0.1.0",
|
||||
"grunt-nsp-shrinkwrap": "0.0.3",
|
||||
"jshint": "2.5.x",
|
||||
"jshint-stylish": "0.4.0",
|
||||
"load-grunt-tasks": "3.1.0",
|
||||
"request": "2.40.0",
|
||||
"tap": "0.4.12",
|
||||
"walk": "2.3.x"
|
||||
|
|
Загрузка…
Ссылка в новой задаче