Coder Social home page Coder Social logo

Support custom tasks about grunt-release HOT 17 CLOSED

geddski avatar geddski commented on August 11, 2024
Support custom tasks

from grunt-release.

Comments (17)

ngryman avatar ngryman commented on August 11, 2024

👍

from grunt-release.

btford avatar btford commented on August 11, 2024

👍

from grunt-release.

eskimoblood avatar eskimoblood commented on August 11, 2024

👍

from grunt-release.

brandonbloom avatar brandonbloom commented on August 11, 2024

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.

from grunt-release.

ngryman avatar ngryman commented on August 11, 2024

Well, this repo doesn't seem to be maintained anymore...

from grunt-release.

geddski avatar geddski commented on August 11, 2024

@ngryman you're welcome to fork or use something else.

from grunt-release.

markcellus avatar markcellus commented on August 11, 2024

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.

from grunt-release.

geddski avatar geddski commented on August 11, 2024

@mkay581 totally

from grunt-release.

drublic avatar drublic commented on August 11, 2024

@mkay581 Hey, could you find the time and work on this? Would be perfect to have it in before we land a major version.

from grunt-release.

markcellus avatar markcellus commented on August 11, 2024

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

from grunt-release.

drublic avatar drublic commented on August 11, 2024

No worries. Just check back when you're done. If anyone else works on it, they will post here I guess :)

from grunt-release.

markcellus avatar markcellus commented on August 11, 2024

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?

from grunt-release.

pmb0 avatar pmb0 commented on August 11, 2024

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.

from grunt-release.

markcellus avatar markcellus commented on August 11, 2024

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

from grunt-release.

markcellus avatar markcellus commented on August 11, 2024

@pmb0 pull request created here: #105. Let me know if this is what you were thinking.

from grunt-release.

pmb0 avatar pmb0 commented on August 11, 2024

Thank you @mkay581! I think that is the fix. Looking forward to the patch. :)

from grunt-release.

drublic avatar drublic commented on August 11, 2024

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 :)

from grunt-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.