bchr02 / node-pre-gyp-github

A node-pre-gyp module which provides the ability to publish to GitHub releases.
MIT License
52 stars 32 forks source link

Expose release option to publish subcommand #5

Closed jacobrosenthal closed 8 years ago

jacobrosenthal commented 8 years ago

We use a CI server to release, and if the release isn't publish node-pre-gyp-github doesnt appear to be able to find the current release and add binaries to it.

My solution was to just hardcode draft:false which has been working for us but wed like to upstream, see https://github.com/voodootikigod/node-serialport/issues/644

Ive broken them out maintaining the defaults, and added the -r option to the publish subcommand which sets draft:false.

Could use a good test yet. Thoughts?

bchr02 commented 8 years ago

@jacobrosenthal Thanks for this pull request! These will be great additions. Some issues though.

NodePreGypGithub.prototype.createRelease = function(args, callback) {
    var options = {
        'owner': options.owner || this.owner,
        'repo': this.repo,
        'tag_name': this.package_json.version,
        'target_commitish': 'master',
        'name': 'v' + this.package_json.version,
        'body': this.package_json.name + ' ' + this.package_json.version,
        'draft': true,
        'prerelease': false
    };

    Object.keys(args).forEach(function(key) {
        options[key] = args[key] || options[key];
    });

    this.github.authenticate(this.authenticate_settings());
    this.github.releases.createRelease(options, callback);
};

Can you kindly make these updates and resubmit? Thanks.

bchr02 commented 8 years ago

@jacobrosenthal are you going to make these changes? Or would you rather I just make them?

jacobrosenthal commented 8 years ago

Im in rural wisconsin in and out of bandwidth on family issues right now. If you want to that would be totally fine with me :) Otherwise I fly out this weekend.

bchr02 commented 8 years ago

Thanks for this @jacobrosenthal. I went ahead and added these through a separate commit. Therefore I am closing this one.