From 3c4d52e67678178bcc3b745126d39be7753957f3 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 29 Apr 2016 21:34:57 +0200 Subject: [PATCH] Add tag in release filename --- .gitignore | 2 +- Gruntfile.js | 10 ++++++++-- package.json | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0fb6d93..af93b59 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ vendor/ templates_c/ ffmpeg.tar.xz ffmpeg-*/ -alltube-release.zip +alltube-*.zip coverage/ bower_components/ config.yml diff --git a/Gruntfile.js b/Gruntfile.js index 3dcbf99..1d05fad 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,6 +3,11 @@ module.exports = function (grunt) { 'use strict'; grunt.initConfig( { + githash: { + main: { + options: {} + } + }, uglify: { combine: { files: { @@ -52,7 +57,7 @@ module.exports = function (grunt) { compress: { release: { options: { - archive: 'alltube-release.zip' + archive: 'alltube-<%= githash.main.tag %>.zip' }, src: ['*.php', '!config.yml', 'dist/**', 'fonts/**', '.htaccess', 'img/**', 'js/**', 'LICENSE', 'README.md', 'robots.txt', 'sitemap.xml', 'templates/**', 'templates_c/', 'vendor/**', 'classes/**', 'controllers/**', 'bower_components/**', '!vendor/ffmpeg/**', '!vendor/bin/ffmpeg'] } @@ -60,6 +65,7 @@ module.exports = function (grunt) { } ); + grunt.loadNpmTasks('grunt-githash'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-watch'); @@ -70,5 +76,5 @@ module.exports = function (grunt) { grunt.registerTask('default', ['uglify', 'cssmin']); grunt.registerTask('lint', ['phpcs']); grunt.registerTask('test', ['phpunit']); - grunt.registerTask('release', ['default', 'compress']); + grunt.registerTask('release', ['default', 'githash', 'compress']); }; diff --git a/package.json b/package.json index d6213e8..5e4480d 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "grunt-phpcs": "~0.4.0", "grunt-phpunit": "~0.3.6", "grunt-contrib-compress": "~1.2.0", - "bower": "~1.7.1" + "bower": "~1.7.1", + "grunt-githash": "~0.1.3" }, "repository": { "type": "git",