openai/openai-java

Public

mirrored from https://github.com/openai/openai-javaAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
release-please--branches--main--changes--next

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/create-releases.yml

90lines · modeblame

817fc11astainless-app[bot]1 years ago1name: Create releases
2on:
3schedule:
4- cron: '0 5 * * *' # every day at 5am UTC
5push:
6branches:
7- main
8
9jobs:
10release:
11name: release
12if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-java'
13runs-on: ubuntu-latest
bbb66f87Justin Beckwith2 months ago14environment: publish
9323041eJustin Beckwith2 months ago15outputs:
16releases_created: ${{ steps.release.outputs.releases_created }}
817fc11astainless-app[bot]1 years ago17
18steps:
3349f806Drew Hintz4 months ago19- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
817fc11astainless-app[bot]1 years ago20
e2c268ddstainless-app[bot]3 months ago21- uses: stainless-api/trigger-release-please@bb6677c5a04578eec1ccfd9e1913b5b78ed64c61 # v1.4.0
817fc11astainless-app[bot]1 years ago22id: release
23with:
24repo: ${{ github.event.repository.full_name }}
25stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
26
9323041eJustin Beckwith2 months ago27publish:
28name: publish
29needs: release
30if: ${{ needs.release.outputs.releases_created == 'true' }}
31runs-on: ubuntu-latest
32environment: publish
33
34steps:
35- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
36
817fc11astainless-app[bot]1 years ago37- name: Set up Java
3349f806Drew Hintz4 months ago38uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
817fc11astainless-app[bot]1 years ago39with:
40distribution: temurin
41java-version: |
428
210f88c7stainless-app[bot]11 months ago4321
817fc11astainless-app[bot]1 years ago44cache: gradle
45
46- name: Set up Gradle
3349f806Drew Hintz4 months ago47uses: gradle/gradle-build-action@fe583dc97e032f41ccc310ea5176f2d7306abbc4 # v2
817fc11astainless-app[bot]1 years ago48
71cf8abdstainless-app[bot]1 years ago49- name: Compile the openai-java-core project
50run: |
51./gradlew :openai-java-core:compileJava :openai-java-core:compileTestJava -x test
52
af653cffstainless-app[bot]6 months ago53- name: Run the mock server
71cf8abdstainless-app[bot]1 years ago54run: |
55./scripts/mock --daemon
56
57- name: Setup GraalVM
3349f806Drew Hintz4 months ago58uses: graalvm/setup-graalvm@03e8abf916fd0e281b2efe7b2da3378bb0a1d085 # v1
71cf8abdstainless-app[bot]1 years ago59with:
60java-version: 21
61distribution: 'graalvm-community'
62cache: gradle
63
64- name: Run tests on the openai-java-core project with the GraalVM native-image agent
65run: |
66./gradlew :openai-java-core:test -x compileJava -x compileTestJava -x compileKotlin -x compileTestKotlin -PgraalvmAgent
67
68- name: Check generated GraalVM file
69run: |
70echo "Checking for GraalVM agent metadata files..."
71DIRECTORY=openai-java-core/src/main/resources/META-INF/native-image
72if [ -d "$DIRECTORY" ] && [ "$(ls -A $DIRECTORY)" ]; then
73echo "Files found in $DIRECTORY:"
74ls -l $DIRECTORY
75else
76echo "No files found in $DIRECTORY"
77exit 1
78fi
79
817fc11astainless-app[bot]1 years ago80- name: Publish to Sonatype
81run: |-
82export -- GPG_SIGNING_KEY_ID
83printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
84GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
07bf7aa8stainless-app[bot]12 months ago85./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
817fc11astainless-app[bot]1 years ago86env:
9323041eJustin Beckwith2 months ago87SONATYPE_USERNAME: ${{ secrets.OPENAI_SONATYPE_USERNAME }}
88SONATYPE_PASSWORD: ${{ secrets.OPENAI_SONATYPE_PASSWORD }}
89GPG_SIGNING_KEY: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY }}
90GPG_SIGNING_PASSWORD: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_PASSWORD }}