Skip to content

Commit

Permalink
chore(build): fix up the release task within gulp (#31)
Browse files Browse the repository at this point in the history
This change fixes up the release task to properly tag and publish to NPM. It also includes a new gulp release:version task to alter the package version.
  • Loading branch information
kirkyoder authored Feb 22, 2023
1 parent 3a2ceb3 commit 7f5e745
Show file tree
Hide file tree
Showing 4 changed files with 11,786 additions and 7,588 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ This will run the `gulp test:coverage` command and then take the
output coverage reports and use the systems 'genhtml' command to
produce a browsable HTML page displaying coverage information per file.

### `gulp release:version`
This will increment the package version. By default it will increment the patch portion of the version number, but you can supply the `type` argument and provide a value of `major`, `minor`, or `patch` to the command (e.g. `gulp release:version --type major`) to force a different release type.

### `gulp release`
The release command will build the library, run the test suite, and if all tests pass will up the version found in package.json and finally publish the library to npm. By default it will increment the patch
portion of the version number but you can append 'major', 'minor', or 'patch' to the command (ex `gulp release:major`) to force a different release type.
The release command will build the library, run the test suite, and if all tests pass will publish the library to npm.

### `gulp`
The default action is to clean the source directory and compile the library again.
7 changes: 7 additions & 0 deletions gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ npmlog = require("npm/node_modules/npmlog")

# gulp related includes
gulp = require("gulp")
bump = require("gulp-bump")
coffee = require("gulp-coffee")
coffeeCov = require("gulp-coffee-coverage")
concat = require("gulp-concat")
Expand Down Expand Up @@ -158,6 +159,12 @@ gulp.task("release:organize", gulp.series("test", "minify", ->
}))
))

gulp.task("release:version", ->
return gulp.src("./package.json")
.pipe(bump({ type: args.type }))
.pipe(gulp.dest("./"))
)

gulp.task("release", gulp.series("release:organize", (cb) ->
pkg = require("./package.json")
npm.load(pkg, (err) ->
Expand Down
Loading

0 comments on commit 7f5e745

Please sign in to comment.