Skip to content

Commit

Permalink
Copied gulp tasks from GRAF
Browse files Browse the repository at this point in the history
  • Loading branch information
Gawdl3y committed Aug 17, 2016
1 parent beb3d12 commit ef19328
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const exec = require('gulp-exec');
const eslint = require('gulp-eslint');
const del = require('del');

// Build scripts
gulp.task('build', () =>
gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
Expand All @@ -13,23 +14,33 @@ gulp.task('build', () =>
.pipe(gulp.dest('lib'))
);

// Clean built scripts
gulp.task('clean', () => del('lib/**'));

// Clean then build
gulp.task('rebuild', gulp.series('clean', 'build'));

// Lint scripts
gulp.task('lint', () =>
gulp.src('src/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
);

gulp.task('rebuild', gulp.series('clean', 'build'));
gulp.task('default', gulp.parallel('lint', 'rebuild'));

gulp.task('publish', gulp.series('default', () => {
// Commit & tag version
gulp.task('tag-release', () => {
const version = require('./package.json').version;
return gulp.src('.')
.pipe(exec(`git commit -am "Prepare ${version} release"`))
.pipe(exec(`git tag v${version}`))
.pipe(exec(`git push origin : v${version}`))
.pipe(exec('npm publish'));
}));
.pipe(exec(`git push origin : v${version}`));
});

// Commit & tag and publish to NPM
gulp.task('publish', gulp.parallel('lint', gulp.series('rebuild', 'tag-release', () =>
gulp.src('.')
.pipe(exec('npm publish'))
)));

gulp.task('default', gulp.parallel('lint', 'rebuild'));

0 comments on commit ef19328

Please sign in to comment.