Closed geddski closed 9 years ago
:+1:
:+1:
I could really use the ability to run some custom tasks too. Here's my use case:
I'm publishing a built subfolder, which I need to copy the package.json file in to. If I copy the file before grunt-release runs, then the version number is old. Would be great to run a copy taste between bump and publish.
Well, this repo doesn't seem to be maintained anymore...
@ngryman you're welcome to fork or use something else.
Yeah I would love to see some options like:
{
preReleaseTasks: [],
postReleaseTasks: []
}
that will be arrays of grunt tasks that you want to run before and after the release grunt task begins. I can work on adding this in in the next week or so if @geddski is okay with it.
@mkay581 totally
@mkay581 Hey, could you find the time and work on this? Would be perfect to have it in before we land a major version.
ah my apologies. I ended up getting tied up around the time I responded to this and slipped my mind. I'll take a look later this evening after work and see if I can pull something together and open a pull
No worries. Just check back when you're done. If anyone else works on it, they will post here I guess :)
working on it now... is there a way to denote issues that are "in progress" in your setup? To prevent others from working on the same thing?
Hi, there seems to be an issue with this code:
return function () {
var method = map[taskName],
tasks = options[method];
if (tasks.length) {
grunt.log.ok('running ' + method + ' ');
if (!nowrite) {
grunt.task.run(tasks);
}
}
}
It doesn't return a promise, so
.then(ifEnabled('beforeBumpTasks', runTasks('beforeBump')))
.then(ifEnabled('bump', bump))
.then(ifEnabled('afterBumpTasks', runTasks('afterBump')))
.then(ifEnabled('beforeReleaseTasks', runTasks('beforeRelease')))
doesn't work as expected. I just released a package and my afterBumpTasks
finished after the release
task finished:
$ grunt release
Running "release" task
>> bumped version of bower.json to 1.7.2
>> bumped version of package.json to 1.7.2
>> running afterBumpTasks
>> staged bower.json package.json
>> Committed all files
>> created new git tag: v1.7.2
>> pushed to remote
>> pushed new tag 1.7.2 to remote
>> published version 1.7.2 to npm
>> created v1.7.2 release on github.
Running "less:dist" (less) task
File build/shariff.complete.css created
Running "browserify:dist_complete_min" (browserify) task
Running "browserify:dist_min" (browserify) task
There also seems to be an issue with the custom tasks docs:
afterBump: [], // optional grunt tasks to run after file versions are bumped`
Using afterBump
doesn't work, but afterBumpTasks
does.
yeah you're right, I think there was a mixup with the documentation. i'll open a pull request with change. thanks for pointing that out @pmb0
@pmb0 pull request created here: https://github.com/geddski/grunt-release/pull/105. Let me know if this is what you were thinking.
Thank you @mkay581! I think that is the fix. Looking forward to the patch. :)
This is done now, I guess.
beforeBump: [], // optional grunt tasks to run before file versions are bumped
afterBump: [], // optional grunt tasks to run after file versions are bumped
beforeRelease: [], // optional grunt tasks to run after release version is bumped up but before release is packaged
afterRelease: [], // optional grunt tasks to run after release is packaged
If there are any other issues, please open another issue :)
:+1: