Skip to content

Commit fbcb13f

Browse files
committed
Add test and deploy workflows
1 parent 085aad8 commit fbcb13f

File tree

3 files changed

+183
-6
lines changed

3 files changed

+183
-6
lines changed

.github/workflows/deploy.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy to Maven Central
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- '0.17.x'
8+
paths:
9+
- 'src/main/resources/api.yaml'
10+
- 'pom.xml'
11+
- '.github/workflows/*' # temporary while getting workflow functioning
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/[email protected]
19+
20+
- name: Import GPG signing key
21+
uses: crazy-max/[email protected]
22+
with:
23+
gpg_private_key: ${{ secrets.MVN_SIGNING_KEY }}
24+
passphrase: ${{ secrets.MVN_SIGNING_KEY_PASSPHRASE }}
25+
26+
- uses: actions/[email protected]
27+
with:
28+
distribution: 'temurin'
29+
java-version: '17'
30+
cache: 'maven'
31+
32+
- uses: stCarolas/setup-maven@v5
33+
with:
34+
maven-version: 3.9.9
35+
36+
- uses: s4u/[email protected]
37+
with:
38+
servers: |
39+
[{
40+
"id": "central",
41+
"username": "${{ secrets.MVN_CENTRAL_TOKEN }}",
42+
"password": "${{ secrets.MVN_CENTRAL_PASSWORD }}"
43+
}]
44+
45+
- name: Bundle and publish to Central
46+
run: mvn deploy -P publish

.github/workflows/test.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- '0.17.x'
8+
paths-ignore:
9+
- '**.md'
10+
pull_request:
11+
paths-ignore:
12+
- '**.md'
13+
14+
jobs:
15+
build-tests:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/[email protected]
20+
21+
- uses: actions/[email protected]
22+
with:
23+
distribution: 'temurin'
24+
java-version: '17'
25+
cache: 'maven'
26+
27+
- uses: stCarolas/setup-maven@v5
28+
with:
29+
maven-version: 3.9.9
30+
31+
- name: Build all
32+
run: mvn verify -DskipTests

pom.xml

Lines changed: 105 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,61 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<name>InvenTree SDK (Java)</name>
8-
97
<groupId>com.w3asel</groupId>
108
<artifactId>inventree-sdk-java</artifactId>
119
<packaging>jar</packaging>
1210
<version>0.18.317-SNAPSHOT</version>
1311

12+
<name>InvenTree SDK (Java)</name>
13+
<description>A Java implementation of the OpenAPI spec published by InvenTree to allow interfacing with a server.</description>
14+
<url>https://github.com/1337joe/inventree-sdk-java</url>
15+
1416
<licenses>
1517
<license>
1618
<name>MIT License</name>
1719
<url>http://www.opensource.org/licenses/mit-license.php</url>
1820
</license>
1921
</licenses>
2022

23+
<developers>
24+
<developer>
25+
<name>Joseph Rogers</name>
26+
<email>[email protected]</email>
27+
<url>https://www.w3asel.com</url>
28+
</developer>
29+
</developers>
30+
31+
<scm>
32+
<connection>scm:[email protected]:1337joe/inventree-sdk-java.git</connection>
33+
<developerConnection>scm:[email protected]:1337joe/inventree-sdk-java.git</developerConnection>
34+
<url>https://github.com/1337joe/inventree-sdk-java</url>
35+
</scm>
36+
2137
<properties>
2238
<java.version>1.8</java.version>
2339
<maven.compiler.source>${java.version}</maven.compiler.source>
2440
<maven.compiler.target>${java.version}</maven.compiler.target>
2541
<gson-fire-version>1.9.0</gson-fire-version>
2642
<okhttp-version>4.12.0</okhttp-version>
27-
<gson-version>2.10.1</gson-version>
43+
<gson-version>2.12.1</gson-version>
2844
<commons-lang3-version>3.17.0</commons-lang3-version>
2945
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
3046
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
3147
<beanvalidation-version>2.0.2</beanvalidation-version>
3248
<junit-version>5.10.3</junit-version>
3349
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
34-
<jakarta.ws.rs-api-version>2.1.6</jakarta.ws.rs-api-version>
50+
<jakarta.ws.rs-api-version>4.0.0</jakarta.ws.rs-api-version>
3551
<jsr311-api-version>1.1.1</jsr311-api-version>
3652
<jsr305-version>3.0.2</jsr305-version>
3753
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3854

39-
<junit.version>5.11.3</junit.version>
55+
<junit.version>5.12.1</junit.version>
4056
<plugin-replacer.version>1.5.3</plugin-replacer.version>
41-
<plugin-openapi-generator.version>7.11.0</plugin-openapi-generator.version>
57+
<plugin-openapi-generator.version>7.12.0</plugin-openapi-generator.version>
58+
<plugin-javadoc.version>3.11.2</plugin-javadoc.version>
59+
<plugin-source.version>3.3.1</plugin-source.version>
60+
<plugin-gpg.version>3.2.7</plugin-gpg.version>
61+
<plugin-central-publishing.version>0.7.0</plugin-central-publishing.version>
4262
</properties>
4363

4464
<dependencies>
@@ -255,6 +275,85 @@
255275
</execution>
256276
</executions>
257277
</plugin>
278+
<plugin>
279+
<groupId>org.apache.maven.plugins</groupId>
280+
<artifactId>maven-javadoc-plugin</artifactId>
281+
<version>${plugin-javadoc.version}</version>
282+
<configuration>
283+
<tags>
284+
<tag>
285+
<name>http.response.details</name>
286+
<placement>a</placement>
287+
<head>HTTP Response Details:</head>
288+
</tag>
289+
</tags>
290+
</configuration>
291+
</plugin>
258292
</plugins>
259293
</build>
294+
295+
<profiles>
296+
<profile>
297+
<id>publish</id>
298+
<properties>
299+
<skipTests>true</skipTests>
300+
</properties>
301+
<build>
302+
<plugins>
303+
<plugin>
304+
<groupId>org.apache.maven.plugins</groupId>
305+
<artifactId>maven-javadoc-plugin</artifactId>
306+
<version>${plugin-javadoc.version}</version>
307+
<executions>
308+
<execution>
309+
<id>attach-javadocs</id>
310+
<goals>
311+
<goal>jar</goal>
312+
</goals>
313+
</execution>
314+
</executions>
315+
</plugin>
316+
<plugin>
317+
<groupId>org.apache.maven.plugins</groupId>
318+
<artifactId>maven-source-plugin</artifactId>
319+
<version>${plugin-source.version}</version>
320+
<executions>
321+
<execution>
322+
<id>attach-sources</id>
323+
<goals>
324+
<goal>jar-no-fork</goal>
325+
</goals>
326+
</execution>
327+
</executions>
328+
</plugin>
329+
<plugin>
330+
<groupId>org.apache.maven.plugins</groupId>
331+
<artifactId>maven-gpg-plugin</artifactId>
332+
<version>${plugin-gpg.version}</version>
333+
<executions>
334+
<execution>
335+
<id>sign-artifacts</id>
336+
<phase>verify</phase>
337+
<goals>
338+
<goal>sign</goal>
339+
</goals>
340+
</execution>
341+
</executions>
342+
</plugin>
343+
<plugin>
344+
<groupId>org.sonatype.central</groupId>
345+
<artifactId>central-publishing-maven-plugin</artifactId>
346+
<version>${plugin-central-publishing.version}</version>
347+
<extensions>true</extensions>
348+
<configuration>
349+
<publishingServerId>central</publishingServerId>
350+
<autoPublish>true</autoPublish>
351+
<waitUntil>published</waitUntil>
352+
<checksums>required</checksums>
353+
</configuration>
354+
</plugin>
355+
</plugins>
356+
</build>
357+
</profile>
358+
</profiles>
260359
</project>

0 commit comments

Comments
 (0)