diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml new file mode 100644 index 00000000..94624b97 --- /dev/null +++ b/.github/workflows/publish-sonatype.yml @@ -0,0 +1,39 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to Sonatype in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/langchain-ai/langsmith-java/actions/workflows/publish-sonatype.yml +name: Publish Sonatype +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: | + 8 + 17 + cache: gradle + + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + + - name: Publish to Sonatype + run: | + ./gradlew publish --stacktrace + env: + SONATYPE_USERNAME: ${{ secrets.LANG_SMITH_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.LANG_SMITH_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY_ID: ${{ secrets.LANG_SMITH_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }} + GPG_SIGNING_KEY: ${{ secrets.LANG_SMITH_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.LANG_SMITH_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..3b502eaf --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,23 @@ +name: Release Doctor +on: + pull_request: + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'langchain-ai/langsmith-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v3 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + SONATYPE_USERNAME: ${{ secrets.LANG_SMITH_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.LANG_SMITH_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY_ID: ${{ secrets.LANG_SMITH_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }} + GPG_SIGNING_KEY: ${{ secrets.LANG_SMITH_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.LANG_SMITH_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} diff --git a/.gradle/8.0.2/checksums/checksums.lock b/.gradle/8.0.2/checksums/checksums.lock index 7bba4a11..ecc0baf3 100644 Binary files a/.gradle/8.0.2/checksums/checksums.lock and b/.gradle/8.0.2/checksums/checksums.lock differ diff --git a/.gradle/8.0.2/executionHistory/executionHistory.bin b/.gradle/8.0.2/executionHistory/executionHistory.bin index 8a74db72..faf4462e 100644 Binary files a/.gradle/8.0.2/executionHistory/executionHistory.bin and b/.gradle/8.0.2/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.0.2/executionHistory/executionHistory.lock b/.gradle/8.0.2/executionHistory/executionHistory.lock index e2a991bf..8ab87a7f 100644 Binary files a/.gradle/8.0.2/executionHistory/executionHistory.lock and b/.gradle/8.0.2/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.0.2/fileHashes/fileHashes.bin b/.gradle/8.0.2/fileHashes/fileHashes.bin index b7581fa4..7973fc08 100644 Binary files a/.gradle/8.0.2/fileHashes/fileHashes.bin and b/.gradle/8.0.2/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.0.2/fileHashes/fileHashes.lock b/.gradle/8.0.2/fileHashes/fileHashes.lock index f159fd26..86d17c84 100644 Binary files a/.gradle/8.0.2/fileHashes/fileHashes.lock and b/.gradle/8.0.2/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.0.2/fileHashes/resourceHashesCache.bin b/.gradle/8.0.2/fileHashes/resourceHashesCache.bin index aba9ccfb..848392c3 100644 Binary files a/.gradle/8.0.2/fileHashes/resourceHashesCache.bin and b/.gradle/8.0.2/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index f48a64ea..54a6da70 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index f207b91e..0d30fa87 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..c4762802 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} \ No newline at end of file diff --git a/README.md b/README.md index e12b2d8f..4a618bc6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ # Lang Smith Java API Library + + [![Maven Central](https://img.shields.io/maven-central/v/com.langsmith.api/langsmith-java)](https://central.sonatype.com/artifact/com.langsmith.api/langsmith-java/0.0.1-alpha.0) + + The Lang Smith Java SDK provides convenient access to the Lang Smith REST API from applications written in Java. It includes helper classes with helpful types and documentation for every request and response property. The Lang Smith Java SDK is similar to the Lang Smith Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions. @@ -18,6 +22,8 @@ The REST API documentation can be foundĀ [on docs.langsmith.com](https://docs.La #### Gradle + + ```kotlin implementation("com.langsmith.api:langsmith-java:0.0.1-alpha.0") ``` @@ -32,6 +38,8 @@ implementation("com.langsmith.api:langsmith-java:0.0.1-alpha.0") ``` + + ### Configure the client Use `LangSmithOkHttpClient.builder()` to configure the client. At a minimum you need to set `.apiKey()`: @@ -214,4 +222,4 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/langsmith-java/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/langchain-ai/langsmith-java/issues) with questions, bugs, or suggestions. diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 00000000..12b1f65d --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +warnings=() +errors=() + +if [ -z "${SONATYPE_USERNAME}" ]; then + warnings+=("The LANG_SMITH_SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +if [ -z "${SONATYPE_PASSWORD}" ]; then + warnings+=("The LANG_SMITH_SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +if [ -z "${GPG_SIGNING_KEY}" ]; then + warnings+=("The LANG_SMITH_SONATYPE_GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +if [ -z "${GPG_SIGNING_PASSWORD}" ]; then + warnings+=("The LANG_SMITH_SONATYPE_GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenWarnings=${#warnings[@]} + +if [[ lenWarnings -gt 0 ]]; then + echo -e "Found the following warnings in the release environment:\n" + + for warning in "${warnings[@]}"; do + echo -e "- $warning\n" + done +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/build.gradle.kts b/build.gradle.kts index 32ae4893..5675f376 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { allprojects { group = "com.langsmith.api" - version = "0.0.1-alpha.0" + version = "0.0.1-alpha.0" // x-release-please-version } nexusPublishing { diff --git a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin index b2b105a7..75628bdb 100644 Binary files a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin and b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.bin differ diff --git a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock index d8c56fc3..51190aa8 100644 Binary files a/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock and b/buildSrc/.gradle/8.0.2/executionHistory/executionHistory.lock differ diff --git a/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock index ca081d63..4a6ca60d 100644 Binary files a/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin b/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin index 02a9f3ab..5239bea4 100644 Binary files a/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin and b/buildSrc/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/buildSrc/src/main/kotlin/langsmith.publish.gradle.kts b/buildSrc/src/main/kotlin/langsmith.publish.gradle.kts index 30ba9082..4663b002 100644 --- a/buildSrc/src/main/kotlin/langsmith.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/langsmith.publish.gradle.kts @@ -33,9 +33,9 @@ configure { } scm { - connection.set("scm:git:git://github.com/stainless-sdks/langsmith-java.git") - developerConnection.set("scm:git:git://github.com/stainless-sdks/langsmith-java.git") - url.set("https://github.com/stainless-sdks/langsmith-java") + connection.set("scm:git:git://github.com/langchain-ai/langsmith-java.git") + developerConnection.set("scm:git:git://github.com/langchain-ai/langsmith-java.git") + url.set("https://github.com/langchain-ai/langsmith-java") } versionMapping { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..8f987198 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,67 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "simple", + "extra-files": [ + "README.md", + "build.gradle.kts" + ] +} \ No newline at end of file