Skip to content

Commit 3459db9

Browse files
committed
feat: initial commit
1 parent a6fddc0 commit 3459db9

File tree

333 files changed

+50088
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+50088
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# syntax=docker/dockerfile:1
2+
FROM debian:bookworm-slim
3+
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
libxkbcommon0 \
6+
ca-certificates \
7+
ca-certificates-java \
8+
make \
9+
curl \
10+
git \
11+
openjdk-17-jdk-headless \
12+
unzip \
13+
libc++1 \
14+
vim \
15+
&& apt-get clean autoclean
16+
17+
# Ensure UTF-8 encoding
18+
ENV LANG=C.UTF-8
19+
ENV LC_ALL=C.UTF-8
20+
21+
WORKDIR /workspace
22+
23+
COPY . /workspace

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
}
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
// "features": {},
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Configure tool-specific properties.
16+
// "customizations": {},
17+
18+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19+
// "remoteUser": "root"
20+
}

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file is used to automatically assign reviewers to PRs
2+
# For more information see: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
3+
4+
* @openai/sdks-team

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
- next
10+
11+
jobs:
12+
lint:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
if: github.repository == 'openai/openai-java'
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Validate Gradle wrapper
21+
uses: gradle/actions/wrapper-validation@v3
22+
23+
- name: Set up Java
24+
uses: actions/setup-java@v4
25+
with:
26+
distribution: temurin
27+
java-version: |
28+
8
29+
17
30+
cache: gradle
31+
32+
- name: Set up Gradle
33+
uses: gradle/gradle-build-action@v2
34+
35+
- name: Run lints
36+
run: ./scripts/lint
37+
test:
38+
name: test
39+
runs-on: ubuntu-latest
40+
if: github.repository == 'openai/openai-java'
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Java
46+
uses: actions/setup-java@v4
47+
with:
48+
distribution: temurin
49+
java-version: |
50+
8
51+
17
52+
cache: gradle
53+
54+
- name: Set up Gradle
55+
uses: gradle/gradle-build-action@v2
56+
57+
- name: Run tests
58+
run: ./scripts/test
59+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-java'
13+
runs-on: ubuntu-latest
14+
environment: publish
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: stainless-api/trigger-release-please@v1
20+
id: release
21+
with:
22+
repo: ${{ github.event.repository.full_name }}
23+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
24+
25+
- name: Set up Java
26+
if: ${{ steps.release.outputs.releases_created }}
27+
uses: actions/setup-java@v3
28+
with:
29+
distribution: temurin
30+
java-version: |
31+
8
32+
17
33+
cache: gradle
34+
35+
- name: Set up Gradle
36+
if: ${{ steps.release.outputs.releases_created }}
37+
uses: gradle/gradle-build-action@v2
38+
39+
- name: Publish to Sonatype
40+
if: ${{ steps.release.outputs.releases_created }}
41+
run: |
42+
./gradlew --parallel --no-daemon publish
43+
env:
44+
SONATYPE_USERNAME: ${{ secrets.OPENAI_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
45+
SONATYPE_PASSWORD: ${{ secrets.OPENAI_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
46+
GPG_SIGNING_KEY_ID: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
47+
GPG_SIGNING_KEY: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
48+
GPG_SIGNING_PASSWORD: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# workflow for re-running publishing to Sonatype in case it fails for some reason
2+
# you can run this workflow by navigating to https://www.github.com/openai/openai-java/actions/workflows/publish-sonatype.yml
3+
name: Publish Sonatype
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
name: publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Java
16+
uses: actions/setup-java@v3
17+
with:
18+
distribution: temurin
19+
java-version: |
20+
8
21+
17
22+
cache: gradle
23+
24+
- name: Set up Gradle
25+
uses: gradle/gradle-build-action@v2
26+
27+
- name: Publish to Sonatype
28+
run: |
29+
./gradlew --parallel --no-daemon publish
30+
env:
31+
SONATYPE_USERNAME: ${{ secrets.OPENAI_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
32+
SONATYPE_PASSWORD: ${{ secrets.OPENAI_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
33+
GPG_SIGNING_KEY_ID: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
34+
GPG_SIGNING_KEY: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
35+
GPG_SIGNING_PASSWORD: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release Doctor
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
environment: publish
13+
if: github.repository == 'openai/openai-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Check release environment
19+
run: |
20+
bash ./bin/check-release-environment
21+
env:
22+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
23+
SONATYPE_USERNAME: ${{ secrets.OPENAI_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
24+
SONATYPE_PASSWORD: ${{ secrets.OPENAI_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
25+
GPG_SIGNING_KEY_ID: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
26+
GPG_SIGNING_KEY: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
27+
GPG_SIGNING_PASSWORD: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.prism.log
2+
.gradle
3+
.idea
4+
build
5+
codegen.log
6+
kls_database.db

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1-alpha.0"
3+
}

0 commit comments

Comments
 (0)