File tree Expand file tree Collapse file tree 6 files changed +61
-17
lines changed
Expand file tree Collapse file tree 6 files changed +61
-17
lines changed Original file line number Diff line number Diff line change @@ -26,19 +26,21 @@ jobs:
2626 needs : tagpr
2727 if : needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch'
2828 runs-on : ubuntu-latest
29+ permissions :
30+ contents : read
31+ packages : write
2932 steps :
3033 - uses : actions/checkout@v4
3134 - name : Set up JDK 21
3235 uses : actions/setup-java@v4
3336 with :
3437 distribution : temurin
3538 java-version : 21
39+ - name : Setup Gradle
40+ uses : gradle/actions/setup-gradle@v4
3641 - name : Test
3742 run : ./gradlew test
38- - name : Publish
39- run : ./gradlew publishAllPublicationsToMavenCentralRepository
43+ - name : Publish to GitHub Packages
44+ run : ./gradlew publish
4045 env :
41- ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
42- ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
43- ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.SIGNING_KEY }}
44- ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets.SIGNING_KEY_PASSWORD }}
46+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1- ![ Maven Central ] ( https://img.shields.io/maven-central/v/com. launchableinc. openai-java/client?color=blue )
1+ [ ![ GitHub Packages ] ( https://img.shields.io/badge/GitHub%20Packages-Available-green )] ( https://github.com/ launchableinc/ openai-java/packages )
22
33> ⚠️OpenAI has deprecated all Engine-based APIs.
44> See [ Deprecated Endpoints] ( https://github.com/launchableinc/openai-java#deprecated-endpoints ) below
Original file line number Diff line number Diff line change 11apply plugin : ' java-library'
2- apply plugin : " com.vanniktech.maven.publish"
32
43dependencies {
54 api libs. jacksonAnnotations
Original file line number Diff line number Diff line change 11plugins {
2- id " com.vanniktech. maven. publish" version " 0.34.0 "
2+ id ' maven- publish'
33}
44
5- allprojects {
6- plugins. withId(" com.vanniktech.maven.publish" ) {
7- mavenPublishing {
8- // Publish to Central Portal (new Maven Central publishing system)
9- publishToMavenCentral()
10- signAllPublications()
5+ subprojects {
6+ apply plugin : ' maven-publish'
7+
8+ plugins. withId(' java' ) {
9+ publishing {
10+ repositories {
11+ maven {
12+ name = " GitHubPackages"
13+ url = " https://maven.pkg.github.com/launchableinc/openai-java"
14+ credentials {
15+ username = System . getenv(" GITHUB_ACTOR" )
16+ password = System . getenv(" GITHUB_TOKEN" )
17+ }
18+ }
19+ }
20+
21+ publications {
22+ maven(MavenPublication ) {
23+ from components. java
24+
25+ groupId = ' com.launchableinc.openai-java'
26+ artifactId = project. name
27+ version = project. version
28+
29+ pom {
30+ name = ' OpenAI Java Client'
31+ description = ' Java client library for OpenAI API'
32+ url = ' https://github.com/launchableinc/openai-java'
33+
34+ licenses {
35+ license {
36+ name = ' The MIT License'
37+ url = ' https://www.mit.edu/~amini/LICENSE.md'
38+ }
39+ }
40+
41+ developers {
42+ developer {
43+ id = ' engineering'
44+ name = ' Engineering'
45+ }
46+ }
47+
48+ scm {
49+ connection = ' scm:git:git@github.com:launchableinc/openai-java.git'
50+ developerConnection = ' scm:git:git@github.com:launchableinc/openai-java.git'
51+ url = ' https://github.com/launchableinc/openai-java'
52+ }
53+ }
54+ }
55+ }
1156 }
1257 }
1358}
Original file line number Diff line number Diff line change 11apply plugin : ' java-library'
2- apply plugin : " com.vanniktech.maven.publish"
32
43dependencies {
54 api project(" :api" )
Original file line number Diff line number Diff line change 11apply plugin : ' java-library'
2- apply plugin : " com.vanniktech.maven.publish"
32
43dependencies {
54 api project(" :client" )
You can’t perform that action at this time.
0 commit comments