Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

ahatzz11
Copy link
Contributor

@ahatzz11 ahatzz11 commented Jun 16, 2022

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.

@@ -34,6 +35,9 @@ This plugin uses [OkHttp](http://square.github.io/okhttp/) to send a POST reques
If you are using multiple GithubRelease tasks to compose a single release, the release must be published `draft=false` with the first task. Currently, the plugin cannot find an existing release if it is a draft.

## Changelog
2.4.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 I'm not sure how strictly this repo follows semver, but as a new feature I thought a minor bump would be appropriate.

@ahatzz11 ahatzz11 changed the title Add support for github generated release notes, fixes #51 Add support for github generated release notes, closes #51 Jun 16, 2022
@BreadMoirai
Copy link
Owner

Looks good to me! Thanks for the contribution

@BreadMoirai BreadMoirai self-requested a review June 17, 2022 01:40
@BreadMoirai BreadMoirai merged commit 07940c0 into BreadMoirai:master Jun 17, 2022
@ahatzz11 ahatzz11 deleted the feature/add-github-generated-release-notes branch June 17, 2022 01:44
@ahatzz11
Copy link
Contributor Author

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

@BreadMoirai
Copy link
Owner

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
Copy link
Owner

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
Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for github generated changelogs
3 participants