diff --git a/gulpfile.js b/gulpfile.js index 38d0e8a..675f9f9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -210,6 +210,20 @@ var nextVersion; var ghToken; gulp.task('release:init', function (cb) { + ghToken = gutil.env.token; + if (!ghToken) { + return cb(new Error('--token is required (github personal access token')); + } + if (ghToken.length != 40) { + return cb(new Error('--token length must be 40, not ' + ghToken.length)); + } + + nextVersion = pkg.version; + + if (gutil.env.skipnewtag) { + return cb(); + } + var tag = gutil.env.tag; if (!tag) { return cb(new Error('--tag is required')); @@ -217,13 +231,6 @@ gulp.task('release:init', function (cb) { if (['major', 'minor', 'patch'].indexOf(tag) < 0) { return cb(new Error('--tag must be major, minor or patch')); } - ghToken = gutil.env.token; - if (!ghToken) { - return cb(new Error('--token is required (github personal access token')); - } - if (ghToken.length != 40) { - return cb(new Error('--token length must be 40')); - } nextVersion = semver.inc(pkg.version, tag); @@ -248,12 +255,10 @@ gulp.task('bump:json', function () { gulp.task('bump:html', function () { return gulp .src('./index.html') - .pipe(replace(/(.*)<\/sup>/, '' + nextVersion + '')) + .pipe(replace(/(.*)<\/sup>/, '' + pkg.version + '')) .pipe(gulp.dest('.')); }); -gulp.task('bump', gulp.series('bump:json', 'bump:html')); - gulp.task('release:commit', function () { return gulp.src(['./index.html', './package.json']).pipe(git.commit('release: ' + nextVersion)); }); @@ -318,6 +323,7 @@ gulp.task( 'scripts_config', 'layers_config', 'layers', + 'bump:html', 'scripts', 'styles', 'images', @@ -430,7 +436,7 @@ gulp.task( 'release', gulp.series( 'release:init', - 'bump', + 'bump:json', 'release:commit', 'release:tag', 'release:push',