diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml
index c16be2ae8..9524a25f5 100644
--- a/.github/workflows/create-releases.yml
+++ b/.github/workflows/create-releases.yml
@@ -42,7 +42,7 @@ jobs:
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
- ./gradlew --parallel --no-daemon publish
+ ./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
env:
SONATYPE_USERNAME: ${{ secrets.OPENAI_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.OPENAI_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
index a7784791a..e7217bdf3 100644
--- a/.github/workflows/publish-sonatype.yml
+++ b/.github/workflows/publish-sonatype.yml
@@ -29,7 +29,7 @@ jobs:
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
- ./gradlew --parallel --no-daemon publish
+ ./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
env:
SONATYPE_USERNAME: ${{ secrets.OPENAI_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.OPENAI_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1b77f506d..1bc571363 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.7.0"
+ ".": "0.7.1"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4787ffd49..9600b4c7a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.7.1 (2024-12-09)
+
+Full Changelog: [v0.7.0...v0.7.1](https://github.com/openai/openai-java/compare/v0.7.0...v0.7.1)
+
+### Chores
+
+* **internal:** configure sonatype ([#30](https://github.com/openai/openai-java/issues/30)) ([5d7816a](https://github.com/openai/openai-java/commit/5d7816afb9cf70189aa04dfd18a8f77f25094dcf))
+
## 0.7.0 (2024-12-04)
Full Changelog: [v0.6.0...v0.7.0](https://github.com/openai/openai-java/compare/v0.6.0...v0.7.0)
diff --git a/README.md b/README.md
index 93da33df1..6d3c96a6a 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
-[](https://central.sonatype.com/artifact/com.openai/openai-java/0.7.0)
+[](https://central.sonatype.com/artifact/com.openai/openai-java/0.7.1)
@@ -30,7 +30,7 @@ The REST API documentation can be foundĀ on [platform.openai.com](https://platfo
```kotlin
-implementation("com.openai:openai-java:0.7.0")
+implementation("com.openai:openai-java:0.7.1")
```
#### Maven
@@ -39,7 +39,7 @@ implementation("com.openai:openai-java:0.7.0")
com.openai
openai-java
- 0.7.0
+ 0.7.1
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 14ac91f3d..c7289bb3e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,20 +1,10 @@
plugins {
- id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
+
}
allprojects {
group = "com.openai"
- version = "0.7.0" // x-release-please-version
+ version = "0.7.1" // x-release-please-version
}
-nexusPublishing {
- repositories {
- sonatype {
- nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
- snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
- username.set(System.getenv("SONATYPE_USERNAME"))
- password.set(System.getenv("SONATYPE_PASSWORD"))
- }
- }
-}
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index b88cd06fa..493cb3275 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -1,12 +1,16 @@
plugins {
`kotlin-dsl`
+ kotlin("jvm") version "1.9.22"
+ id("com.vanniktech.maven.publish") version "0.28.0"
}
repositories {
gradlePluginPortal()
+ mavenCentral()
}
dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
+ implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
diff --git a/buildSrc/src/main/kotlin/openai.java.gradle.kts b/buildSrc/src/main/kotlin/openai.java.gradle.kts
index 1de5b8a87..32a150edf 100644
--- a/buildSrc/src/main/kotlin/openai.java.gradle.kts
+++ b/buildSrc/src/main/kotlin/openai.java.gradle.kts
@@ -1,6 +1,9 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
-import java.util.Locale
+import com.vanniktech.maven.publish.JavaLibrary
+import com.vanniktech.maven.publish.JavadocJar
+import com.vanniktech.maven.publish.MavenPublishBaseExtension
+import com.vanniktech.maven.publish.SonatypeHost
plugins {
`java-library`
@@ -11,11 +14,6 @@ repositories {
mavenCentral()
}
-configure {
- withJavadocJar()
- withSourcesJar()
-}
-
configure {
java {
importOrder()
@@ -36,10 +34,6 @@ tasks.withType().configureEach {
options.release.set(8)
}
-tasks.named("javadocJar") {
- setZip64(true)
-}
-
tasks.named("jar") {
manifest {
attributes(mapOf(
diff --git a/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts b/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts
index b88c7af98..97905bba9 100644
--- a/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts
+++ b/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts
@@ -1,5 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+import com.vanniktech.maven.publish.*
plugins {
id("openai.java")
diff --git a/buildSrc/src/main/kotlin/openai.publish.gradle.kts b/buildSrc/src/main/kotlin/openai.publish.gradle.kts
index 65218274a..9a0fd1e2d 100644
--- a/buildSrc/src/main/kotlin/openai.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/openai.publish.gradle.kts
@@ -3,65 +3,52 @@ import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.get
+import com.vanniktech.maven.publish.JavaLibrary
+import com.vanniktech.maven.publish.JavadocJar
+import com.vanniktech.maven.publish.MavenPublishBaseExtension
+import com.vanniktech.maven.publish.SonatypeHost
plugins {
- `maven-publish`
- `signing`
+ id("com.vanniktech.maven.publish")
}
-configure {
- publications {
- register("maven") {
- from(components["java"])
+repositories {
+ gradlePluginPortal()
+ mavenCentral()
+}
- pom {
- name.set("OpenAI API")
- description.set("The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference\nfor more details.")
- url.set("https://platform.openai.com/docs")
+extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
+extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
+extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")
- licenses {
- license {
- name.set("Apache-2.0")
- }
- }
+configure {
+ signAllPublications()
+ publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
- developers {
- developer {
- name.set("OpenAI")
- email.set("support@openai.com")
- }
- }
+ this.coordinates(project.group.toString(), project.name, project.version.toString())
- scm {
- connection.set("scm:git:git://github.com/openai/openai-java.git")
- developerConnection.set("scm:git:git://github.com/openai/openai-java.git")
- url.set("https://github.com/openai/openai-java")
- }
+ pom {
+ name.set("OpenAI API")
+ description.set("The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference\nfor more details.")
+ url.set("https://platform.openai.com/docs")
- versionMapping {
- allVariants {
- fromResolutionResult()
- }
- }
+ licenses {
+ license {
+ name.set("Apache-2.0")
}
}
- }
-}
-signing {
- val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
- val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
- val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
- if (signingKey != null && signingPassword != null) {
- useInMemoryPgpKeys(
- signingKeyId,
- signingKey,
- signingPassword,
- )
- sign(publishing.publications["maven"])
- }
-}
+ developers {
+ developer {
+ name.set("OpenAI")
+ email.set("support@openai.com")
+ }
+ }
-tasks.named("publish") {
- dependsOn(":closeAndReleaseSonatypeStagingRepository")
+ scm {
+ connection.set("scm:git:git://github.com/openai/openai-java.git")
+ developerConnection.set("scm:git:git://github.com/openai/openai-java.git")
+ url.set("https://github.com/openai/openai-java")
+ }
+ }
}