Skip to content

Commit

Permalink
Refactor publish workflow and pom
Browse files Browse the repository at this point in the history
Refactor pom to include the nexus-staging-maven-plugin and to move the maven-gpg-plugin into the build tags.

This also refactors the publish workflow by removing the build settings action and to update the deploy command to pass in additional arguments.
  • Loading branch information
mcoats13 committed Oct 29, 2021
1 parent 512ddcd commit df172fd
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 40 deletions.
31 changes: 4 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,22 @@ jobs:
distribution: 'adopt'
java-version: '11'

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Set up Maven Central
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
server-id: ossrh
settings-path: ${{ github.workspace }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
overwrite-settings: false

- name: Build settings file
uses: whelk-io/maven-settings-xml-action@v20
with:
servers: >
[
{
"id": "ossrh",
"username": "${env.MAVEN_USERNAME}",
"password": "${env.MAVEN_PASSWORD}"
},
{
"id": "gpg.passphrase",
"passphrase": "${env.MAVEN_GPG_PASSPHRASE}"
}
]
active_profiles: >
[
"sign-artifacts"
]
output_file: .m2/settings.xml

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to Maven Central
run: mvn clean deploy -s $GITHUB_WORKSPACE/.m2/settings.xml
run: mvn --no-transfer-progress -B -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-java/issues) to report issues using the MX Platform API Java Library.*

# MX Platform Java
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech).*

The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
# MX Platform Java - v0.3.2

For more information, please [visit](https://www.mx.com/products/platform-api)
The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.

*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
Please [visit](https://www.mx.com/products/platform-api) for more information.

## Requirements

Expand All @@ -28,7 +28,7 @@ mvn clean package
```

Then manually install the following JARs:
- `target/mx-platform-java-0.3.1.jar`
- `target/mx-platform-java-0.3.2.jar`
- `target/lib/*.jar`

### Maven users
Expand All @@ -39,7 +39,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.mx</groupId>
<artifactId>mx-platform-java</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
<scope>compile</scope>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion openapi/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiPackage: "com.mx.client.mx-platform-api"
artifactDescription: "A Java library for the MX Platform API"
artifactId: "mx-platform-java"
artifactUrl: "https://github.com/mxenabled/mx-platform-java"
artifactVersion: 0.3.1
artifactVersion: 0.3.2
developerEmail: "[email protected]"
developerName: "MX"
developerOrganization: "MX Technologies Inc."
Expand Down
8 changes: 4 additions & 4 deletions openapi/templates/README.mustache
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-java/issues) to report issues using the MX Platform API Java Library.*

# MX Platform Java
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech).*

# MX Platform Java - v{{{artifactVersion}}}

{{{appDescriptionWithNewLines}}}

{{#infoUrl}}
For more information, please [visit]({{{infoUrl}}})
Please [visit]({{{infoUrl}}}) for more information.
{{/infoUrl}}

*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*

## Requirements

Building the API client library requires:
Expand Down
31 changes: 31 additions & 0 deletions openapi/templates/pom.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,37 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
33 changes: 32 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<artifactId>mx-platform-java</artifactId>
<packaging>jar</packaging>
<name>mx-platform-java</name>
<version>0.3.1</version>
<version>0.3.2</version>
<url>https://github.com/mxenabled/mx-platform-java</url>
<description>A Java library for the MX Platform API</description>
<scm>
Expand Down Expand Up @@ -33,6 +33,37 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mx/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("OpenAPI-Generator/0.3.1/java");
setUserAgent("OpenAPI-Generator/0.3.2/java");

authentications = new HashMap<String, Authentication>();
}
Expand Down

0 comments on commit df172fd

Please sign in to comment.