File tree Expand file tree Collapse file tree 6 files changed +43
-24
lines changed Expand file tree Collapse file tree 6 files changed +43
-24
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ name: Publish
3
3
on :
4
4
push :
5
5
tags :
6
- - ' [0-9]+.[0-9]+.[0-9]+'
6
+ - ' [0-9]+.[0-9]+.[0-9]+-Cronometer '
7
7
8
8
jobs :
9
9
publish :
10
10
runs-on : ubuntu-latest
11
+ permissions : write-all
11
12
12
13
steps :
13
14
- uses : actions/checkout@v3
@@ -18,15 +19,12 @@ jobs:
18
19
distribution : temurin
19
20
java-version : 8
20
21
21
- - name : Test
22
- run : ./gradlew test
23
- env :
24
- OPENAI_TOKEN : ${{ secrets.OPENAI_TOKEN }}
22
+ # - name: Test
23
+ # run: ./gradlew test
24
+ # env:
25
+ # OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
25
26
26
27
- name : Publish
27
- run : ./gradlew build publish --no-parallel
28
+ run : ./gradlew build -x test publish --no-parallel
28
29
env :
29
- ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
30
- ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
31
- ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.SIGNING_KEY }}
32
- ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets.SIGNING_KEY_PASSWORD }}
30
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -165,12 +165,6 @@ Or for an example using functions and stream: [OpenAiApiFunctionsWithStreamExamp
165
165
If you want to shut down your process immediately after streaming responses, call `OpenAiService.shutdownExecutor()`.
166
166
This is not necessary for non-streaming calls.
167
167
168
- ## Local Maven Deploy
169
- Command: `publishToMavenLocal -PRELEASE_SIGNING_ENABLED=false`
170
- `-PRELEASE_SIGNING_ENABLED` will disable artifact signing not needed for local publishes (got an error without this)
171
-
172
- Default maven location is `~/.m2/repository` to specify a location use `-Dmaven.repo.local=<LOCATION>/.m2/repository`
173
-
174
168
## Running the example project
175
169
All the [example](example/src/main/java/example/OpenAiApiExample.java) project requires is your OpenAI api token
176
170
```bash
@@ -189,6 +183,12 @@ Or functions with 'stream' mode enabled:
189
183
./gradlew runExampleThree
190
184
```
191
185
186
+ ## Publishing a package
187
+
188
+ Update the ```VERSION_NAME``` in ```gradle.properties``` to a new version.
189
+ Then create a new release tag in the format ```[0-9]+.[0-9]+.[0-9]+-Cronometer```.
190
+ A GitHub publish action will be triggered on tag creation, causing new package artifacts to be created.
191
+
192
192
## FAQ
193
193
### Does this support GPT-4?
194
194
Yes! GPT-4 uses the ChatCompletion Api, and you can see the latest model options [here](https://platform.openai.com/docs/models/gpt-4).
Original file line number Diff line number Diff line change 1
1
apply plugin : ' java-library'
2
- apply plugin : " com.vanniktech. maven. publish"
2
+ apply plugin : ' maven- publish'
3
3
4
4
dependencies {
5
5
api libs. jacksonAnnotations
Original file line number Diff line number Diff line change 1
1
plugins {
2
- id " com.vanniktech. maven. publish" version " 0.19.0 " apply false
2
+ id( ' maven- publish' )
3
3
}
4
4
5
- allprojects {
6
- plugins. withId(" com.vanniktech.maven.publish" ) {
7
- mavenPublish {
8
- sonatypeHost = " S01"
5
+ subprojects {
6
+ afterEvaluate {
7
+ if (it. plugins. hasPlugin(' maven-publish' )) {
8
+ publishing {
9
+ repositories {
10
+ maven {
11
+ name = " GitHubPackages"
12
+ url = uri(" https://maven.pkg.github.com/cronometersoftware/openai-java" )
13
+ credentials {
14
+ username = System . getenv(" GITHUB_ACTOR" )
15
+ password = System . getenv(" GITHUB_TOKEN" )
16
+ }
17
+ }
18
+ }
19
+ publications {
20
+ " $project . name " (MavenPublication ) {
21
+ afterEvaluate {
22
+ groupId GROUP
23
+ artifactId property(" POM_ARTIFACT_ID" );
24
+ version VERSION_NAME
25
+ from components. java
26
+ }
27
+ }
28
+ }
29
+ }
9
30
}
10
31
}
11
32
}
Original file line number Diff line number Diff line change 1
1
apply plugin : ' java-library'
2
- apply plugin : " com.vanniktech. maven. publish"
2
+ apply plugin : ' maven- publish'
3
3
4
4
dependencies {
5
5
api project(" :api" )
Original file line number Diff line number Diff line change 1
1
apply plugin : ' java-library'
2
- apply plugin : " com.vanniktech. maven. publish"
2
+ apply plugin : ' maven- publish'
3
3
4
4
dependencies {
5
5
api project(" :client" )
You can’t perform that action at this time.
0 commit comments