jutzig / github-release-plugin

uses the github release api to upload files
69 stars 24 forks source link

github-release-plugin

Maven Central

uses the github release api to upload files

To use the plugin you need to configure it in your pom.xml like so

<plugin>
    <groupId>de.jutzig</groupId>
    <artifactId>github-release-plugin</artifactId>
    <version>1.5.0</version>
    <configuration>
        <description>Description of your release</description>
        <releaseName>1.0 Final</releaseName>
        <tag>${project.version}</tag>

        <!-- If your project has additional artifacts, such as ones produced by
             the maven-assembly-plugin, you can define the following
             (requires version 1.1.1 of the plugin or higher): -->
        <fileSets>
            <fileSet>
                <directory>${project.build.directory}</directory>
                <includes>
                    <include>${project.artifactId}*.tar.gz</include>
                    <include>${project.artifactId}*.zip</include>
                </includes>
            </fileSet>
        </fileSets>
    </configuration>
</plugin>

Unless otherwise specified, the plugin will upload the main artifact of your project and take the github repository url from the <scm> section.

By default, the plugin will look for your github credentials in your maven settings.xml. Credentials can be privated as an API token, or username and password. Example

<servers>
    <server>
        <id>github</id>
        <privateKey>API_TOKEN</privateKey>
        <username>GITHUB_USERNAME</username>
        <password>GITHUB_PASSWORD</password>
    </server>
</servers>

These credentials can be overridden by setting username and password as system properties.

Additional Parameters:

The plugin is available on Maven central

Note on release description

The easiest way of getting a good release description (aka release notes or changelog) 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.

Below is an example of how the auto-generated release notes by GitHub could look like:

Screenshot of autogenerated GitHub release notes

You can read how to customize release notes format in GitHub documentation.

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.