openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
.github/workflows/create-releases.yml
44lines · modecode
| 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-python' |
| 13 | runs-on: ubuntu-latest |
| 14 | environment: publish |
| 15 | |
| 16 | steps: |
| 17 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 18 | |
| 19 | - uses: stainless-api/trigger-release-please@bb6677c5a04578eec1ccfd9e1913b5b78ed64c61 # 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 uv |
| 26 | if: ${{ steps.release.outputs.releases_created }} |
| 27 | uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # setup-uv v8.1.0; uv 0.11.8 |
| 28 | with: |
| 29 | version: "0.11.8" |
| 30 | enable-cache: true |
| 31 | |
| 32 | - name: Set up Python |
| 33 | if: ${{ steps.release.outputs.releases_created }} |
| 34 | run: uv python install |
| 35 | |
| 36 | - name: Build |
| 37 | if: ${{ steps.release.outputs.releases_created }} |
| 38 | run: uv build |
| 39 | |
| 40 | - name: Publish to PyPI |
| 41 | if: ${{ steps.release.outputs.releases_created }} |
| 42 | run: uv publish |
| 43 | env: |
| 44 | UV_PUBLISH_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }} |
| 45 | |