Skip to content

Commit

Permalink
Fixes #52: added support for automatically generated release notes.
Browse files Browse the repository at this point in the history
- default behavior: delegate to GitHub
- if `<description>` is supplied via plugin configuration, will be prepended to the notes autogenerated by GitHub.
  • Loading branch information
anenviousguest committed Nov 24, 2023
1 parent 92b5084 commit a55d8be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ Additional Parameters:

The plugin is available on Maven central

## Note on release description
The easiest way of getting a good release description is to defer its generation to the GitHub. So if you completely leave out the `<description>` configuration
parameter, then GitHub will generate a meaningful description for you. Otherwise, if description _is_ supplied, it will be prepended to one generated by GitHub.

## Note on the GitHub API endpoints
The endpoint for GitHub API is inferred from `<scm>` connection string. When missing, it by default would use the public endpoint at https://api.github.com.
If you want to upload to a GitHub enterprise instance, then a respective `<scm>` connection string must be specified.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>1.317</version>
<version>1.318</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class UploadMojo extends AbstractMojo implements Contextualizable{
/**
* The release description
*/
@Parameter(property = "project.description")
@Parameter
private String description;

/**
Expand Down Expand Up @@ -189,6 +189,7 @@ public void execute() throws MojoExecutionException {
if (release == null) {
getLog().info("Creating release "+releaseName);
GHReleaseBuilder builder = repository.createRelease(tag);
builder.generateReleaseNotes(true);
if(description!=null) {
builder.body(description);
}
Expand Down

0 comments on commit a55d8be

Please sign in to comment.