Skip to content

Commit

Permalink
preparing 1.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jutzig committed Nov 18, 2023
1 parent ec6da48 commit 330f19b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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.1.1</version>
<version>1.5.0</version>
<configuration>
<description>Description of your release</description>
<releaseName>1.0 Final</releaseName>
Expand All @@ -35,11 +35,12 @@ To use the plugin you need to configure it in your `pom.xml` like so

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`. Example
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>
Expand All @@ -48,12 +49,13 @@ By default, the plugin will look for your github credentials in your maven `sett

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

Thanks to a contribution from rowanseymour you can also use your API token by adding it as `<privateKey>` to your server definition in the `settings.xml`.

Additional Parameters:

* `-Dgithub.draft=true` creates the release in draft state
* `-Dgithub.commitish=release/1.0.0` allows to specify a commitsh
* `-Dgithub.apitoken=API_TOKEN` allows to set github api token instead of providing it in settings.xml
* `-Dgithub.username=GITHUB_USERNAME` allows to set github username instead of providing it in settings.xml
* `-Dgithub.password=GITHUB_PASSWORD` allows to set github password instead of providing it in settings.xml

The plugin is available on Maven central

Expand Down
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down Expand Up @@ -83,8 +88,9 @@
<goal>install</goal>
<goal>run</goal>
</goals>

<phase>package</phase>
<!-- disabled -->
<phase>none</phase>
<!-- <phase>package</phase> -->
</execution>
</executions>
<dependencies>
Expand Down
6 changes: 6 additions & 0 deletions src/it/test-multi-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
<tag>master</tag>
</scm>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>


<modules>
<module>child1</module>
<module>child2</module>
Expand Down
5 changes: 5 additions & 0 deletions src/it/test-release/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<tag>master</tag>
</scm>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
<resources>
<resource>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/de/jutzig/github/release/plugin/UploadMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ public GitHub createGithub(String serverId) throws MojoExecutionException, IOExc
throw new MojoExecutionException("Unable to lookup SettingsDecrypter: " + cle.getMessage(), cle);
}

String serverUsername = server.getUsername();
String serverPassword = server.getPassword();
String serverAccessToken = server.getPrivateKey();
String serverUsername = System.getProperty("github.username", server.getUsername());
String serverPassword = System.getProperty("github.password", server.getPassword());
String serverAccessToken = System.getProperty("github.apitoken", server.getPrivateKey());
if (StringUtils.isNotEmpty(serverUsername) && StringUtils.isNotEmpty(serverPassword))
return gitHubBuilder.withPassword(serverUsername, serverPassword).build();
else if (StringUtils.isNotEmpty(serverAccessToken))
Expand Down

0 comments on commit 330f19b

Please sign in to comment.