UNPKG

1.77 kBJavaScriptView Raw
1module.exports = function(grunt) {
2 grunt.initConfig({
3
4 clean: {
5 test: 'test/fixtures/_*.json'
6 },
7 nodeunit: {
8 tests: 'test/release_test.js'
9 },
10 release: {
11 options: {
12 bump: true,
13 file: 'package.json',
14 add: true,
15 commit: true,
16 tag: true,
17 push: true,
18 pushTags: true,
19 npm: true,
20 npmtag: false,
21 github: {
22 repo: 'geddski/grunt-release',
23 usernameVar: 'GITHUB_USERNAME',
24 passwordVar: 'GITHUB_PASSWORD'
25 }
26 }
27 },
28 setup: {
29 test: {
30 files: [{
31 src: 'test/fixtures/component.json',
32 dest: 'test/fixtures/_component.json'
33 },{
34 src: 'test/fixtures/bower.json',
35 dest: 'test/fixtures/_bower.json'
36 }]
37 }
38 }
39 });
40
41 grunt.loadTasks('tasks');
42 grunt.loadNpmTasks('grunt-contrib-clean');
43 grunt.loadNpmTasks('grunt-contrib-nodeunit');
44
45 grunt.registerTask('test', [
46 'clean',
47 'setup',
48 'release',
49 'nodeunit',
50 'clean'
51 ]);
52
53 grunt.registerMultiTask('setup', 'Setup test fixtures', function(){
54 this.files.forEach(function(f){
55 grunt.file.copy(f.src, f.dest);
56 });
57 grunt.config.set('release.options.file', 'test/fixtures/_component.json');
58 grunt.config.set('release.options.add', false);
59 grunt.config.set('release.options.commit', false);
60 grunt.config.set('release.options.tag', false);
61 grunt.config.set('release.options.push', false);
62 grunt.config.set('release.options.pushTags', false);
63 grunt.config.set('release.options.npm', false);
64 grunt.config.set('release.options.github', false);
65 grunt.config.set('release.options.additionalFiles', ['test/fixtures/_bower.json']);
66 });
67};