Skip to content
Draft
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
60 changes: 53 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

permissions:
contents: read

jobs:
lint:
timeout-minutes: 15
Expand All @@ -23,6 +26,8 @@ jobs:

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Expand All @@ -42,14 +47,54 @@ jobs:
build:
timeout-minutes: 30
name: build
runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) &&
(github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') &&
!(github.repository == 'stainless-sdks/openai-java' &&
github.event_name == 'push' &&
!startsWith(github.ref, 'refs/heads/stl/'))

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: temurin
java-version: |
8
21
cache: gradle

- name: Set up Gradle
uses: gradle/actions/setup-gradle@0b6dd653ba04f4f93bf581ec31e66cbd7dcb644d # v4

- name: Build SDK
# disable gradle daemon in CI because it is flakey
env:
GRADLE_OPTS: "-Dkotlin.compiler.execution.strategy=in-process"
run: ./scripts/build

upload-maven-artifacts:
timeout-minutes: 30
name: build-and-upload-maven-artifacts
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
runs-on: depot-ubuntu-24.04
if: |-
github.repository == 'stainless-sdks/openai-java' &&
github.event_name == 'push' &&
github.event.head_commit.message != 'codegen metadata' &&
!startsWith(github.ref, 'refs/heads/stl/')

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Expand All @@ -69,10 +114,7 @@ jobs:
GRADLE_OPTS: "-Dkotlin.compiler.execution.strategy=in-process"
run: ./scripts/build

- name: Build and upload Maven artifacts
if: |-
github.repository == 'stainless-sdks/openai-java' &&
!startsWith(github.ref, 'refs/heads/stl/')
- name: Upload Maven artifacts
env:
URL: https://pkg.stainless.com/s
SHA: ${{ github.sha }}
Expand Down Expand Up @@ -121,6 +163,8 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Expand All @@ -141,10 +185,12 @@ jobs:
name: examples
environment: CI
runs-on: ${{ github.repository == 'stainless-sdks/openai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.repository == 'openai/openai-java' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
if: github.repository == 'openai/openai-java' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.head_commit.message != 'codegen metadata'

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/create-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
release:
name: release
Expand All @@ -17,6 +20,8 @@ jobs:

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- uses: stainless-api/trigger-release-please@bb6677c5a04578eec1ccfd9e1913b5b78ed64c61 # v1.4.0
id: release
Expand All @@ -33,6 +38,8 @@ jobs:

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/detect-breaking-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- main
- next

permissions:
contents: read

jobs:
detect_breaking_changes:
runs-on: 'ubuntu-latest'
Expand All @@ -19,6 +22,7 @@ jobs:
with:
# Ensure we can check out the pull request base in the script below.
fetch-depth: ${{ env.FETCH_DEPTH }}
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Expand All @@ -36,4 +40,4 @@ jobs:
# Try to check out previous versions of the breaking change detection script. This ensures that
# we still detect breaking changes when entire files and their tests are removed.
git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
5 changes: 5 additions & 0 deletions .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: Publish Sonatype
on:
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
name: publish
Expand All @@ -12,6 +15,8 @@ jobs:

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Expand Down
Loading