Skip to content

Commit 6040f91

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

File tree

5 files changed

+209
-10
lines changed

5 files changed

+209
-10
lines changed

.github/renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"extends": [
44
"github>1337joe/.github//renovate-presets/default"
55
],
6-
"dependencyDashboard": true
6+
"dependencyDashboard": false
77
}

.github/workflows/deploy.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy to Maven Central
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- 'src/main/resources/api.yaml'
9+
- 'pom.xml'
10+
- '.github/workflows/*' # temporary while getting workflow functioning
11+
release:
12+
types:
13+
- published
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/[email protected]
21+
22+
- name: Import GPG signing key
23+
uses: crazy-max/[email protected]
24+
with:
25+
gpg_private_key: ${{ secrets.MVN_SIGNING_KEY }}
26+
passphrase: ${{ secrets.MVN_SIGNING_KEY_PASSPHRASE }}
27+
28+
- uses: actions/[email protected]
29+
with:
30+
distribution: 'temurin'
31+
java-version: '17'
32+
cache: 'maven'
33+
34+
- uses: stCarolas/setup-maven@v5
35+
with:
36+
maven-version: 3.9.9
37+
38+
- uses: s4u/[email protected]
39+
with:
40+
servers: |
41+
[{
42+
"id": "central",
43+
"username": "${{ secrets.MVN_CENTRAL_TOKEN }}",
44+
"password": "${{ secrets.MVN_CENTRAL_PASSWORD }}"
45+
}]
46+
47+
- name: Set version on release
48+
if: github.event_name == 'release'
49+
run: echo "VERSION_OVERRIDE='-Dschema.version=${GITHUB_REF##*/v}" >> "$GITHUB_ENV"
50+
51+
- name: temp
52+
run: mvn verify -P publish $VERSION_OVERRIDE
53+
54+
- name: Bundle and publish to Central
55+
run: echo "mvn deploy -P publish $VERSION_OVERRIDE""
56+
57+
- name: Attach artifacts to release
58+
if: github.event_name == 'release'
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: |
62+
for f in $(find target -maxdepth 1 -name \*.jar -o -name \*.asc -o -name \*.pom); do
63+
gh release upload ${GITHUB_REF} $f
64+
done

.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

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ Simply include in your dependency pom like so:
1010
<dependency>
1111
<groupId>com.w3asel</groupId>
1212
<artifactId>inventree-sdk-java</artifactId>
13-
<version>0.18.317</version>
13+
<version>0.17.294</version>
1414
</dependency>
1515
```
1616

17-
The version number is a mix of the InvenTree release (0.18) and the schema version (317) with point releases after that when multiple client jars are released against the same schema.
17+
The version number is a mix of the InvenTree release (0.17) and the schema version (294) with point releases after that when multiple client jars are released against the same schema.
18+
19+
The `main` branch of this repository tracks `InvenTree/master` and may not be compatible with the latest stable release. As such, it is published as `-SNAPSHOT` jars, which may be consumed by [adding the central snapshot repository to your pom](https://central.sonatype.org/publish/publish-portal-snapshots/#enabling-snapshot-releases-for-your-namespace).
1820

1921
## Running a Local InvenTree Server
2022

pom.xml

Lines changed: 108 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
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>
12-
<version>0.18.317-SNAPSHOT</version>
10+
<version>${schema.version}</version>
11+
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>
1315

1416
<licenses>
1517
<license>
@@ -18,27 +20,47 @@
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>
38+
<schema.version>0.18.317-SNAPSHOT</schema.version>
39+
2240
<java.version>1.8</java.version>
2341
<maven.compiler.source>${java.version}</maven.compiler.source>
2442
<maven.compiler.target>${java.version}</maven.compiler.target>
2543
<gson-fire-version>1.9.0</gson-fire-version>
2644
<okhttp-version>4.12.0</okhttp-version>
27-
<gson-version>2.10.1</gson-version>
45+
<gson-version>2.12.1</gson-version>
2846
<commons-lang3-version>3.17.0</commons-lang3-version>
2947
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
3048
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
3149
<beanvalidation-version>2.0.2</beanvalidation-version>
3250
<junit-version>5.10.3</junit-version>
3351
<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>
52+
<jakarta.ws.rs-api-version>4.0.0</jakarta.ws.rs-api-version>
3553
<jsr311-api-version>1.1.1</jsr311-api-version>
3654
<jsr305-version>3.0.2</jsr305-version>
3755
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3856

39-
<junit.version>5.11.3</junit.version>
57+
<junit.version>5.12.1</junit.version>
4058
<plugin-replacer.version>1.5.3</plugin-replacer.version>
41-
<plugin-openapi-generator.version>7.11.0</plugin-openapi-generator.version>
59+
<plugin-openapi-generator.version>7.12.0</plugin-openapi-generator.version>
60+
<plugin-javadoc.version>3.11.2</plugin-javadoc.version>
61+
<plugin-source.version>3.3.1</plugin-source.version>
62+
<plugin-gpg.version>3.2.7</plugin-gpg.version>
63+
<plugin-central-publishing.version>0.7.0</plugin-central-publishing.version>
4264
</properties>
4365

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

0 commit comments

Comments
 (0)