Add Grunt release task to create a .zip archive of the build/ dir

This adds the new `release` Grunt task which creates a .zip file in the
`release/[version]/` dir with the following name format and structure:

`[name]-[version].zip` where `name` and `version` are from package.json.
.
└── kimono
    └── 0.0.1
        └── *.css
This commit is contained in:
Eric Ferraiuolo 2013-05-14 15:58:25 -04:00
parent f0d71204bf
commit 52c6ac538b
3 changed files with 27 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.DS_Store
build/
node_modules/
release/

View File

@ -23,6 +23,7 @@ grunt.initConfig({
clean: {
build : ['build/'],
build_res: ['build/*-r.css'],
release : ['release/<%= pkg.version %>/'],
base : ['src/base/css/', 'src/base/tests/', 'src/base/LICENSE.md']
},
@ -157,6 +158,21 @@ grunt.initConfig({
}
},
// -- Compress Config ------------------------------------------------------
compress: {
release: {
options: {
archive: 'release/<%= pkg.version %>/<%= pkg.name %>-<%= pkg.version %>.zip'
},
expand : true,
flatten: true,
src : 'build/*.css',
dest : '<%= pkg.name %>/<%= pkg.version %>/'
}
},
// -- Contextualize Config -------------------------------------------------
contextualize: {
@ -178,6 +194,7 @@ grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('default', [
'clean:build',
@ -192,6 +209,12 @@ grunt.registerTask('import', [
'import-normalize'
]);
grunt.registerTask('release', [
'default',
'clean:release',
'compress:release'
]);
// -- Import Tasks -------------------------------------------------------------
grunt.registerTask('import-normalize', [

View File

@ -1,5 +1,5 @@
{
"name": "Kimono",
"name": "kimono",
"version": "0.0.1",
"private": true,
"devDependencies": {
@ -8,6 +8,7 @@
"grunt-contrib-cssmin": "~0.6.0",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0"
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-compress": "~0.5.0"
}
}