Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quite simple solution to avoid callback #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,58 @@ The following are all the release steps, you can disable any you need to:
}
```

### How to run a task between bump and publish.

The idea here is simply to complete the process of a deployment, which is:
* bump
* do something
* publish

```
grunt.initConfig({
// some configuration here ....

// then the release configuration
release: {
bump: {
options: {
bump: true,
add: false,
commit: false,
tag: false,
push: false,
pushTags: false,
npm : false
}
},
publish: {
options: {
bump: false,
commitMessage: 'bump version <%= version %>',
github: {
// your conf
}
}
}
}
});

// register a task which enable the following process:
// * bump package.json (or any other json file)
// * do something like create a dist version
// * tag, push, publish
//
// run this task with --type option
// $ grunt dist --type minor
//
grunt.registerTask('deploy', function () {
var version = grunt.option('type') || 'patch'; // default to patch
grunt.task.run('release:bump:' + version);
grunt.task.run(/* your task(s) */);
grunt.task.run('release:publish');
});
```

### Notes on Github Releases:
1. Yes, you have to use environment variables. I would be a terrible person if I let you check in your username and password into your source code.
2. The [Github Releases API](http://developer.github.com/v3/repos/releases/) is still unstable and may change in the next couple months or so.
Expand Down
3 changes: 1 addition & 2 deletions tasks/grunt-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ var shell = require('shelljs');
var semver = require('semver');

module.exports = function(grunt){
grunt.registerTask('release', 'bump version, git tag, git push, npm publish', function(type){

grunt.registerMultiTask('release', 'bump version, git tag, git push, npm publish', function(type){
//defaults
var options = this.options({
bump: true,
Expand Down