Skip to content

Create releases

Create releases #22

name: Create releases
on:
schedule:
- cron: '0 5 * * *' # every day at 5am UTC
push:
branches:
- main
jobs:
release:
name: release
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-java'
runs-on: ubuntu-latest
environment: publish
steps:
- uses: actions/checkout@v4
- uses: stainless-api/trigger-release-please@v1
id: release
with:
repo: ${{ github.event.repository.full_name }}
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
- name: Set up Java
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: |
8
17
cache: gradle
- name: Set up Gradle
if: ${{ steps.release.outputs.releases_created }}
uses: gradle/gradle-build-action@v2
- name: Publish to Sonatype
if: ${{ steps.release.outputs.releases_created }}
run: |
./gradlew --parallel --no-daemon publish
env:
SONATYPE_USERNAME: ${{ secrets.OPENAI_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.OPENAI_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY_ID: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.OPENAI_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}