shipkit icon indicating copy to clipboard operation
shipkit copied to clipboard

Release to GH and add generated files to release

Open magx2 opened this issue 6 years ago • 8 comments

I'm interested in feature that allows to add files to GH releases, i.e. this release has attached source code (zip and tar), but if you, as a owner of this repo, can click Edit and attach some generic files.

What is the use case? Right now I'm working on Java GUI and all my released version (all two) are on release page. Why I'm not using Bintray/Maven? Because it's looking nicer and user of my app do not need to leave GH to download it - I see it as more user friendly.

So now let's jump to code. I think this feature should look more or less like this:

shipkit {
    gitHub.repository = "wwilk/shipkit-demo"
    gitHub.readOnlyAuthToken = "e7fe8fcfd6ffedac384c8c4c71b2a48e646"
    gitHub.releaseFiles = [
        "${buildDir}/foo/boo.xyz",
        "${buildDir}/foo/baz.abc",
    ]
}

This code will add both files into newly created release on GH.

Looking forward to hear from you guys!

magx2 avatar Aug 22 '19 19:08 magx2

API to do this https://developer.github.com/v3/repos/releases/#upload-a-release-asset

magx2 avatar Aug 22 '19 21:08 magx2

Gradle plugin that might be helpful https://github.com/BreadMoirai/github-release-gradle-plugin

magx2 avatar Aug 22 '19 21:08 magx2

@magx2 Maybe you can try to use github-release-gradle-plugin with shipkit?

mstachniuk avatar Aug 23 '19 07:08 mstachniuk

Yeah I also started thinking about it, but it would be nice to have this functionality in shipkit natively.

magx2 avatar Aug 23 '19 07:08 magx2

I tryied github-release-gradle-plugin. The problem is that this plugin creates release description and uploads files in one task githubRelease so it will override changelog generated by Shipkit. So it will be nice to add a possibility to upload artefacts by Shipkit.

@magx2 do you like to create PR to Shipkit for that? I can help you.

mstachniuk avatar Aug 23 '19 22:08 mstachniuk

Sorry but right now I'm fully involved in Supla project

magx2 avatar Aug 28 '19 14:08 magx2

that looks like a fun task to at least try, and as we do have somewhat limitations of staying at home, i will try to do this. if somebody is faster than me, please go ahead

aepfli avatar Mar 30 '20 11:03 aepfli

Okay i just share my thoughts here, before i start implementing something. just let me know, if i am on the right path or if i should rethink my approach:

  1. the suggestion in here looks pretty straight forward
  2. but i also thought about it, and it would be actually nice to use the outcome of the BinTrayUpload also for the release on github, but i am not sure how to tackle this

regarding 1. i found org.shipkit.internal.gradle.notes.tasks.UpdateReleaseNotesOnGitHub which actually sets the release notes, and is already doing the right call to the github api. I would simply go for an addition here. As i do need the ID of the release anyways to update it with Asset Upload API. What are your thoughts on that?

The downside i see from this, is that everyone still needs to define the artifacts, while actually the bintray task already has a list of those. so we come to Point 2. The mighty less configuration approach, which will definitly take more effort. If we decide on that approach, i would suggest to open a separate issue and still go with the 1. approach in the beginning, and than with some introduction from your side, aim for the 2. solution.

I hope it is fine, that i am taking some time with this, and please let me know, if my approach 1 is fine, or if you suggest to extract it further.

Thanks

aepfli avatar Mar 31 '20 18:03 aepfli