Initial version
This commit is contained in:
60
Gruntfile.js
Normal file
60
Gruntfile.js
Normal file
@@ -0,0 +1,60 @@
|
||||
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' ]);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user