mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Automating release process
This commit is contained in:
+19
-8
@@ -21,10 +21,8 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
|
||||
update_json: {
|
||||
bower: {
|
||||
src: 'package.json',
|
||||
dest: 'bower.json',
|
||||
package2bower: {
|
||||
all: {
|
||||
fields: [
|
||||
'name',
|
||||
'description',
|
||||
@@ -68,8 +66,6 @@ module.exports = function(grunt) {
|
||||
all: ['test/unit/**/*.js']
|
||||
},
|
||||
|
||||
webpack: require('./webpack.config.js'),
|
||||
|
||||
watch: {
|
||||
build: {
|
||||
files: ['lib/**/*.js'],
|
||||
@@ -79,10 +75,25 @@ module.exports = function(grunt) {
|
||||
files: ['lib/**/*.js', 'test/**/*.js', '!test/typescript/axios.js', '!test/typescript/out.js'],
|
||||
tasks: ['test']
|
||||
}
|
||||
},
|
||||
|
||||
webpack: require('./webpack.config.js')
|
||||
});
|
||||
|
||||
grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function () {
|
||||
var npm = grunt.file.readJSON('package.json');
|
||||
var bower = grunt.file.readJSON('bower.json');
|
||||
var fields = this.data.fields || [];
|
||||
|
||||
for (var i=0, l=fields.length; i<l; i++) {
|
||||
var field = fields[i];
|
||||
bower[field] = npm[field];
|
||||
}
|
||||
|
||||
grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
|
||||
});
|
||||
|
||||
grunt.registerTask('test', 'Run the jasmine and nodeunit tests', ['eslint', 'nodeunit', 'karma:single', 'ts']);
|
||||
grunt.registerTask('build', 'Run webpack and bundle the source', ['webpack']);
|
||||
grunt.registerTask('publish', 'Prepare the code for release', ['clean', 'test', 'build', 'usebanner', 'update_json']);
|
||||
grunt.registerTask('build', 'Run webpack and bundle the source', ['clean', 'webpack']);
|
||||
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user