Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: go live #6

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Publish to Sonatype
run: |
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
./gradlew --parallel --no-daemon publish
env:
SONATYPE_USERNAME: ${{ secrets.OPENLAYER_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.OPENLAYER_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.prism.log
.gradle
.idea
build
Expand Down
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 6
configured_endpoints: 8
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/org.openlayer/openlayer-java)](https://central.sonatype.com/artifact/org.openlayer/openlayer-java/0.1.0-alpha.1)
[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.1)

<!-- x-release-please-end -->

Expand All @@ -27,14 +27,14 @@ The REST API documentation can be found [on openlayer.com](https://openlayer.co
<!-- x-release-please-start-version -->

```kotlin
implementation("org.openlayer:openlayer-java:0.1.0-alpha.1")
implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.1")
```

#### Maven

```xml
<dependency>
<groupId>org.openlayer</groupId>
<groupId>com.openlayer.api</groupId>
<artifactId>openlayer-java</artifactId>
<version>0.1.0-alpha.1</version>
</dependency>
Expand Down Expand Up @@ -72,9 +72,9 @@ To create a new inference pipeline data, first use the `InferencePipelineDataStr
then pass that to the `stream` method of the `data` service.

```java
import com.openlayer.api.models.InferencePipelineDataStreamParams;
import com.openlayer.api.models.InferencePipelineDataStreamResponse;
import java.util.List;
import org.openlayer.models.InferencePipelineDataStreamParams;
import org.openlayer.models.InferencePipelineDataStreamResponse;

InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.builder()
.rows(List.of(InferencePipelineDataStreamParams.Row.builder().build()))
Expand Down
14 changes: 12 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
plugins {

id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

allprojects {
group = "org.openlayer"
group = "com.openlayer.api"
version = "0.1.0-alpha.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"))
}
}
}
4 changes: 0 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
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")
}
14 changes: 10 additions & 4 deletions buildSrc/src/main/kotlin/openlayer.java.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import java.util.Locale

plugins {
`java-library`
Expand All @@ -14,6 +11,11 @@ repositories {
mavenCentral()
}

configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
}

configure<SpotlessExtension> {
java {
importOrder()
Expand All @@ -33,6 +35,10 @@ tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
}

tasks.named<Jar>("javadocJar") {
setZip64(true)
}

tasks.named<Jar>("jar") {
manifest {
attributes(mapOf(
Expand Down
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/openlayer.kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.vanniktech.maven.publish.*

plugins {
id("openlayer.java")
Expand Down
83 changes: 48 additions & 35 deletions buildSrc/src/main/kotlin/openlayer.publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,65 @@ 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 {
id("com.vanniktech.maven.publish")
`maven-publish`
`signing`
}

repositories {
gradlePluginPortal()
mavenCentral()
}
configure<PublishingExtension> {
publications {
register<MavenPublication>("maven") {
from(components["java"])

extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")
pom {
name.set("Openlayer API")
description.set("API for interacting with the Openlayer server.")
url.set("https://openlayer.com/docs/api-reference/rest/overview")

configure<MavenPublishBaseExtension> {
signAllPublications()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
licenses {
license {
name.set("Apache-2.0")
}
}

this.coordinates(project.group.toString(), project.name, project.version.toString())
developers {
developer {
name.set("Openlayer")
email.set("[email protected]")
}
}

pom {
name.set("Openlayer API")
description.set("API for interacting with the Openlayer server.")
url.set("https://openlayer.com/docs/api-reference/rest/overview")
scm {
connection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
developerConnection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
url.set("https://github.com/openlayer-ai/openlayer-java")
}

licenses {
license {
name.set("Apache-2.0")
}
}

developers {
developer {
name.set("Openlayer")
email.set("[email protected]")
versionMapping {
allVariants {
fromResolutionResult()
}
}
}
}
}
}

scm {
connection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
developerConnection.set("scm:git:git://github.com/openlayer-ai/openlayer-java.git")
url.set("https://github.com/openlayer-ai/openlayer-java")
}
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"])
}
}

tasks.named("publish") {
dependsOn(":closeAndReleaseSonatypeStagingRepository")
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package org.openlayer.client.okhttp
package com.openlayer.api.client.okhttp

import com.google.common.collect.ListMultimap
import com.google.common.collect.MultimapBuilder
import com.openlayer.api.core.RequestOptions
import com.openlayer.api.core.http.HttpClient
import com.openlayer.api.core.http.HttpMethod
import com.openlayer.api.core.http.HttpRequest
import com.openlayer.api.core.http.HttpRequestBody
import com.openlayer.api.core.http.HttpResponse
import com.openlayer.api.errors.OpenlayerIoException
import java.io.IOException
import java.io.InputStream
import java.net.Proxy
Expand All @@ -19,13 +26,6 @@ import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import okio.BufferedSink
import org.openlayer.core.RequestOptions
import org.openlayer.core.http.HttpClient
import org.openlayer.core.http.HttpMethod
import org.openlayer.core.http.HttpRequest
import org.openlayer.core.http.HttpRequestBody
import org.openlayer.core.http.HttpResponse
import org.openlayer.errors.OpenlayerIoException

class OkHttpClient
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// File generated from our OpenAPI spec by Stainless.

package org.openlayer.client.okhttp
package com.openlayer.api.client.okhttp

import com.fasterxml.jackson.databind.json.JsonMapper
import com.openlayer.api.client.OpenlayerClient
import com.openlayer.api.client.OpenlayerClientImpl
import com.openlayer.api.core.ClientOptions
import java.net.Proxy
import java.time.Clock
import java.time.Duration
import org.openlayer.client.OpenlayerClient
import org.openlayer.client.OpenlayerClientImpl
import org.openlayer.core.ClientOptions

class OpenlayerOkHttpClient private constructor() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// File generated from our OpenAPI spec by Stainless.

package org.openlayer.client.okhttp
package com.openlayer.api.client.okhttp

import com.fasterxml.jackson.databind.json.JsonMapper
import com.openlayer.api.client.OpenlayerClientAsync
import com.openlayer.api.client.OpenlayerClientAsyncImpl
import com.openlayer.api.core.ClientOptions
import java.net.Proxy
import java.time.Clock
import java.time.Duration
import org.openlayer.client.OpenlayerClientAsync
import org.openlayer.client.OpenlayerClientAsyncImpl
import org.openlayer.core.ClientOptions

class OpenlayerOkHttpClientAsync private constructor() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102

package org.openlayer.client
package com.openlayer.api.client

import org.openlayer.models.*
import org.openlayer.services.blocking.*
import com.openlayer.api.models.*
import com.openlayer.api.services.blocking.*

interface OpenlayerClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102

package org.openlayer.client
package com.openlayer.api.client

import org.openlayer.models.*
import org.openlayer.services.async.*
import com.openlayer.api.models.*
import com.openlayer.api.services.async.*

interface OpenlayerClientAsync {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// File generated from our OpenAPI spec by Stainless.

package org.openlayer.client

import org.openlayer.core.ClientOptions
import org.openlayer.core.http.HttpResponse.Handler
import org.openlayer.errors.OpenlayerError
import org.openlayer.models.*
import org.openlayer.services.async.*
import org.openlayer.services.errorHandler
package com.openlayer.api.client

import com.openlayer.api.core.ClientOptions
import com.openlayer.api.core.http.HttpResponse.Handler
import com.openlayer.api.errors.OpenlayerError
import com.openlayer.api.models.*
import com.openlayer.api.services.async.*
import com.openlayer.api.services.errorHandler

class OpenlayerClientAsyncImpl
constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// File generated from our OpenAPI spec by Stainless.

package org.openlayer.client

import org.openlayer.core.ClientOptions
import org.openlayer.core.http.HttpResponse.Handler
import org.openlayer.errors.OpenlayerError
import org.openlayer.models.*
import org.openlayer.services.blocking.*
import org.openlayer.services.errorHandler
package com.openlayer.api.client

import com.openlayer.api.core.ClientOptions
import com.openlayer.api.core.http.HttpResponse.Handler
import com.openlayer.api.errors.OpenlayerError
import com.openlayer.api.models.*
import com.openlayer.api.services.blocking.*
import com.openlayer.api.services.errorHandler

class OpenlayerClientImpl
constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.openlayer.core
package com.openlayer.api.core

import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.core.ObjectCodec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.openlayer.core
package com.openlayer.api.core

import com.fasterxml.jackson.databind.ser.std.StdSerializer
import kotlin.reflect.KClass
Expand Down
Loading