BreadMoirai / github-release-gradle-plugin

A Gradle Plugin to send Releases to Github
Apache License 2.0
108 stars 26 forks source link

Add support for github generated release notes, closes #51 #52

Closed ahatzz11 closed 2 years ago

ahatzz11 commented 2 years ago

Fixes #51, which is around being able to use the generated release notes that github provides.

This is natively supported in the github API to create a release, so I just piggybacked onto that API call: https://docs.github.com/en/rest/releases/releases#create-a-release

I set the default to false to match what github does, and to prevent duplicate logs in situations like using body(changelog()). If it is set to true and a body is also provided, the body will be pre-pended to the generated notes. If a name is not provided, one will be generated (I believe it uses the tag based on my limited testing).

Kotlin usage:

githubRelease {
    generateReleaseNotes(true)
}

Groovy usage:

githubRelease {
    generateReleaseNotes.set true
}

Each teams is also able to customize the syntax and groupings of the release that is generated by github with a .github/release.yaml file in the repo (with no work on the plugin side). More information here: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes (<- This kind of extra info might be helpful to have for people in the wiki).


I'm a first time contributor, so let me know if there's anything I missed! I'm also happy to update the wiki with this new parameter, but it doesn't look like I have access to it.

BreadMoirai commented 2 years ago

Looks good to me! Thanks for the contribution

ahatzz11 commented 2 years ago

@BreadMoirai how do the releases happen? I'd love to start using this.

BreadMoirai commented 2 years ago

I've published the release as 2.4.1 I've also opened the wiki for anyone to edit if you wanted to update that as well.

BreadMoirai commented 2 years ago

Since the plugin is published to the gradle plugin portal, only I can publish it as it's under my account currently If you wanted to use your dev branch, you can run the publishToMavenLocal task and consume it from there. See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:maven_local

ahatzz11 commented 2 years ago

Awesome thanks! I just updated the wiki as well: https://github.com/BreadMoirai/github-release-gradle-plugin/wiki#generatereleasenotes

I did so some small testing locally with publishToMavelLocal - thanks again!