Skip to content

Commit 273851f

Browse files
Merge pull request #129 from skyflowapi/SK-1663-java-sdk-v2-scaffolding
SK-1623 Java SDK v2
2 parents 6927876 + 1eb16d7 commit 273851f

244 files changed

Lines changed: 28249 additions & 9739 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Publish package to the JFROG Artifactory
2+
on:
3+
push:
4+
tags: '*.*.*'
5+
paths-ignore:
6+
- "pom.xml"
7+
- "*.md"
8+
branches:
9+
- release/*
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.ref_name }}
18+
fetch-depth: 0
19+
20+
- name: Set up Jfrog artifactory
21+
uses: actions/setup-java@v1
22+
with:
23+
java-version: '1.8'
24+
distribution: 'adopt'
25+
server-id: central
26+
server-username: JFROG_USERNAME
27+
server-password: JFROG_PASSWORD
28+
gpg-private-key: ${{ secrets.JFROG_GPG_KEY }} # Value of the GPG private key to import
29+
gpg-passphrase: JFROG_GPG_PASSPHRASE # env variable for GPG private key passphrase
30+
31+
- name: Get Previous tag
32+
id: previoustag
33+
uses: WyriHaximus/github-action-get-previous-tag@v1
34+
with:
35+
fallback: 1.0.0
36+
37+
- name: Bump Version
38+
run: |
39+
chmod +x ./scripts/bump_version.sh
40+
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")"
41+
42+
- name: Commit changes
43+
run: |
44+
git config user.name ${{ github.actor }}
45+
git config user.email ${{ github.actor }}@users.noreply.github.com
46+
git add pom.xml
47+
git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev.$(git rev-parse --short $GITHUB_SHA)"
48+
git push origin -f
49+
50+
- name: Create env
51+
id: create-env
52+
run: |
53+
touch .env
54+
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
55+
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
56+
57+
- name: Create credentials json
58+
id: create-json
59+
uses: jsdaniell/create-json@1.1.2
60+
with:
61+
name: "credentials.json"
62+
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
63+
64+
- name: Publish package to Jfrog Artifactory
65+
run: mvn clean deploy -P jfrog
66+
env:
67+
JFROG_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
68+
JFROG_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
69+
JFROG_GPG_PASSPHRASE: ${{ secrets.JFROG_GPG_PASSPHRASE }}

.github/workflows/pr.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: PR CI Checks
22

3-
on: [ pull_request ]
3+
on: [pull_request]
44

55
jobs:
66
check-commit-message:
@@ -11,18 +11,18 @@ jobs:
1111
uses: gsactions/commit-message-checker@v1
1212
with:
1313
pattern: '\[?[A-Z]{1,5}-[1-9][0-9]*.+$'
14-
flags: 'gm'
15-
excludeDescription: 'true'
16-
checkAllCommitMessages: 'true'
14+
flags: "gm"
15+
excludeDescription: "true"
16+
checkAllCommitMessages: "true"
1717
accessToken: ${{ secrets.PAT_ACTIONS }}
18-
error: 'One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )'
18+
error: "One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )"
1919
Test:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v1
2323
- uses: actions/setup-java@v1
2424
with:
25-
java-version: '1.8'
25+
java-version: "1.8"
2626

2727
- name: create-json
2828
id: create-json
@@ -31,6 +31,13 @@ jobs:
3131
name: "credentials.json"
3232
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
3333

34+
- name: create env
35+
id: create-env
36+
run: |
37+
touch .env
38+
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
39+
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
40+
3441
- name: Build & Run tests with Maven
3542
run: mvn -B package -DTEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} -DTEST_DATA_CREDENTIALS_FILE=${{ secrets.TEST_DATA_CREDENTIALS_FILE }} -f pom.xml
3643

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
2727

2828
- name: Publish package to Maven Central
29-
run: mvn --batch-mode deploy
29+
run: mvn --batch-mode deploy -P maven-central
3030
env:
3131
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3232
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

pom.xml

Lines changed: 126 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -32,63 +32,77 @@
3232
</scm>
3333

3434
<properties>
35-
<maven.compiler.source>7</maven.compiler.source>
36-
<maven.compiler.target>7</maven.compiler.target>
35+
<maven.compiler.source>8</maven.compiler.source>
36+
<maven.compiler.target>8</maven.compiler.target>
37+
<okhttp-version>4.12.0</okhttp-version>
38+
<gson-version>2.10.1</gson-version>
39+
<gson-fire-version>1.9.0</gson-fire-version>
40+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41+
<okhttp-version>4.12.0</okhttp-version>
42+
<junit-version>4.13.2</junit-version>
43+
<javax-xml-bind-version>2.3.1</javax-xml-bind-version>
44+
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
3745
</properties>
3846

39-
<distributionManagement>
40-
<snapshotRepository>
41-
<id>ossrh</id>
42-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
43-
</snapshotRepository>
44-
<repository>
45-
<id>ossrh</id>
46-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
47-
</repository>
48-
</distributionManagement>
49-
5047
<dependencies>
48+
<!-- newly added v2 dependencies -->
5149
<dependency>
52-
<groupId>com.fasterxml.jackson.core</groupId>
53-
<artifactId>jackson-core</artifactId>
54-
<version>2.13.0</version>
50+
<groupId>io.github.cdimascio</groupId>
51+
<artifactId>dotenv-java</artifactId>
52+
<version>2.2.0</version>
5553
</dependency>
5654
<dependency>
57-
<groupId>com.googlecode.json-simple</groupId>
58-
<artifactId>json-simple</artifactId>
59-
<version>1.1.1</version>
55+
<groupId>com.google.code.findbugs</groupId>
56+
<artifactId>jsr305</artifactId>
57+
<version>3.0.2</version>
6058
</dependency>
6159
<dependency>
62-
<groupId>io.jsonwebtoken</groupId>
63-
<artifactId>jjwt</artifactId>
64-
<version>0.9.1</version>
60+
<groupId>io.gsonfire</groupId>
61+
<artifactId>gson-fire</artifactId>
62+
<version>${gson-fire-version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>com.google.code.gson</groupId>
66+
<artifactId>gson</artifactId>
67+
<version>${gson-version}</version>
6568
</dependency>
69+
<dependency>
70+
<groupId>com.squareup.okhttp3</groupId>
71+
<artifactId>okhttp</artifactId>
72+
<version>${okhttp-version}</version>
73+
</dependency>
74+
<dependency>
75+
<groupId>com.squareup.okhttp3</groupId>
76+
<artifactId>logging-interceptor</artifactId>
77+
<version>${okhttp-version}</version>
78+
</dependency>
79+
<!-- existing dependencies -->
6680
<dependency>
6781
<groupId>commons-codec</groupId>
6882
<artifactId>commons-codec</artifactId>
6983
<version>1.15</version>
7084
</dependency>
7185
<dependency>
72-
<groupId>javax.xml.bind</groupId>
73-
<artifactId>jaxb-api</artifactId>
74-
<version>2.3.1</version>
86+
<groupId>io.jsonwebtoken</groupId>
87+
<artifactId>jjwt</artifactId>
88+
<version>0.12.6</version>
7589
</dependency>
7690
<dependency>
77-
<groupId>io.jsonwebtoken</groupId>
78-
<artifactId>jjwt-impl</artifactId>
79-
<version>0.11.2</version>
80-
<scope>runtime</scope>
91+
<groupId>jakarta.annotation</groupId>
92+
<artifactId>jakarta.annotation-api</artifactId>
93+
<version>${jakarta-annotation-version}</version>
94+
<scope>provided</scope>
8195
</dependency>
8296
<dependency>
83-
<groupId>io.jsonwebtoken</groupId>
84-
<artifactId>jjwt-jackson</artifactId>
85-
<version>0.11.2</version>
86-
<scope>runtime</scope>
97+
<groupId>javax.xml.bind</groupId>
98+
<artifactId>jaxb-api</artifactId>
99+
<version>${javax-xml-bind-version}</version>
87100
</dependency>
101+
<!-- existing test dependencies -->
88102
<dependency>
89103
<groupId>junit</groupId>
90104
<artifactId>junit</artifactId>
91-
<version>4.13.2</version>
105+
<version>${junit-version}</version>
92106
<scope>test</scope>
93107
</dependency>
94108
<dependency>
@@ -107,17 +121,17 @@
107121

108122
<build>
109123
<plugins>
110-
<plugin>
111-
<groupId>org.sonatype.plugins</groupId>
112-
<artifactId>nexus-staging-maven-plugin</artifactId>
113-
<version>1.6.7</version>
114-
<extensions>true</extensions>
115-
<configuration>
116-
<serverId>ossrh</serverId>
117-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
118-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
119-
</configuration>
120-
</plugin>
124+
<!-- <plugin>-->
125+
<!-- <groupId>org.sonatype.plugins</groupId>-->
126+
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
127+
<!-- <version>1.6.7</version>-->
128+
<!-- <extensions>true</extensions>-->
129+
<!-- <configuration>-->
130+
<!-- <serverId>ossrh</serverId>-->
131+
<!-- <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>-->
132+
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
133+
<!-- </configuration>-->
134+
<!-- </plugin>-->
121135
<plugin>
122136
<groupId>org.apache.maven.plugins</groupId>
123137
<artifactId>maven-source-plugin</artifactId>
@@ -135,6 +149,14 @@
135149
<groupId>org.apache.maven.plugins</groupId>
136150
<artifactId>maven-javadoc-plugin</artifactId>
137151
<version>3.2.0</version>
152+
<configuration>
153+
<excludePackageNames>
154+
:com.skyflow.generated.rest
155+
:com.skyflow.generated.rest.api
156+
:com.skyflow.generated.rest.auth
157+
:com.skyflow.generated.rest.models
158+
</excludePackageNames>
159+
</configuration>
138160
<executions>
139161
<execution>
140162
<id>attach-javadocs</id>
@@ -153,11 +175,6 @@
153175
<groupId>org.jacoco</groupId>
154176
<artifactId>jacoco-maven-plugin</artifactId>
155177
<version>0.8.7</version>
156-
<configuration>
157-
<excludes>
158-
<exclude>**/example/*</exclude>
159-
</excludes>
160-
</configuration>
161178
<executions>
162179
<execution>
163180
<id>prepare-agent</id>
@@ -173,6 +190,26 @@
173190
</goals>
174191
</execution>
175192
</executions>
193+
<configuration>
194+
<excludes>
195+
<exclude>**/example/*</exclude>
196+
<exclude>**/generated/**</exclude>
197+
</excludes>
198+
</configuration>
199+
</plugin>
200+
<plugin>
201+
<groupId>org.apache.maven.plugins</groupId>
202+
<artifactId>maven-jar-plugin</artifactId>
203+
<version>3.3.0</version>
204+
<executions>
205+
<execution>
206+
<goals>
207+
<goal>test-jar</goal>
208+
</goals>
209+
</execution>
210+
</executions>
211+
<configuration>
212+
</configuration>
176213
</plugin>
177214
<plugin>
178215
<groupId>org.apache.maven.plugins</groupId>
@@ -197,5 +234,43 @@
197234
</plugin>
198235
</plugins>
199236
</build>
237+
<repositories>
238+
<repository>
239+
<id>maven_central</id>
240+
<name>Maven Central</name>
241+
<url>https://repo.maven.apache.org/maven2/</url>
242+
</repository>
243+
</repositories>
244+
245+
<profiles>
246+
<profile>
247+
<id>maven-central</id>
248+
<distributionManagement>
249+
<repository>
250+
<id>ossrh</id>
251+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
252+
</repository>
253+
<snapshotRepository>
254+
<id>ossrh</id>
255+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
256+
</snapshotRepository>
257+
</distributionManagement>
258+
</profile>
259+
<profile>
260+
<id>jfrog</id>
261+
<distributionManagement>
262+
<repository>
263+
<id>central</id>
264+
<name>prekarilabs.jfrog.io-releases</name>
265+
<url>https://prekarilabs.jfrog.io/artifactory/skyflow-java</url>
266+
</repository>
267+
<snapshotRepository>
268+
<id>snapshots</id>
269+
<name>prekarilabs.jfrog.io-snapshots</name>
270+
<url>https://prekarilabs.jfrog.io/artifactory/skyflow-java</url>
271+
</snapshotRepository>
272+
</distributionManagement>
273+
</profile>
274+
</profiles>
200275

201-
</project>
276+
</project>

0 commit comments

Comments
 (0)