61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
|
module.exports = function(grunt) {
|
||
|
|
||
|
// Project configuration.
|
||
|
grunt.initConfig({
|
||
|
pkg: grunt.file.readJSON( 'package.json' ),
|
||
|
|
||
|
// Tasks here
|
||
|
version: {
|
||
|
control: {
|
||
|
options: {
|
||
|
prefix: 'Version: '
|
||
|
},
|
||
|
src: [ 'control' ],
|
||
|
},
|
||
|
python: {
|
||
|
options: {
|
||
|
prefix: '__version__\\s*=\\s*\"'
|
||
|
},
|
||
|
src: [ 'src/*.py' ],
|
||
|
}
|
||
|
},
|
||
|
gitcommit: {
|
||
|
version: {
|
||
|
options: {
|
||
|
message: 'Updated version: <%= pkg.version %>'
|
||
|
},
|
||
|
files: {
|
||
|
// Specify the files you want to commit
|
||
|
src: ['style.css', 'package.json', 'functions.php']
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
gittag: {
|
||
|
version: {
|
||
|
options: {
|
||
|
tag: 'alertme-<%= pkg.version %>',
|
||
|
message: 'Tagging version <%= pkg.version %>'
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
gitpush: {
|
||
|
version: {},
|
||
|
tag: {
|
||
|
options: {
|
||
|
tags: true
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
});
|
||
|
|
||
|
// Load all grunt plugins here
|
||
|
grunt.loadNpmTasks('grunt-version');
|
||
|
|
||
|
// Bump version task
|
||
|
grunt.registerTask( 'bump', [ 'version' ]);
|
||
|
|
||
|
// Release task
|
||
|
grunt.registerTask( 'release', [ 'version', 'gitcommit', 'gittag', 'gitpush' ]);
|
||
|
|
||
|
};
|