openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
.github/workflows/create-releases.yml
35lines · modecode
| 1 | name: Create releases |
| 2 | on: |
| 3 | push: |
| 4 | branches: |
| 5 | - main |
| 6 | |
| 7 | jobs: |
| 8 | release: |
| 9 | name: release |
| 10 | if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-python' |
| 11 | runs-on: ubuntu-latest |
| 12 | environment: publish |
| 13 | |
| 14 | steps: |
| 15 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 16 | |
| 17 | - uses: stainless-api/trigger-release-please@bb6677c5a04578eec1ccfd9e1913b5b78ed64c61 # v1.4.0 |
| 18 | id: release |
| 19 | with: |
| 20 | repo: ${{ github.event.repository.full_name }} |
| 21 | stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} |
| 22 | |
| 23 | - name: Set up Rye |
| 24 | if: ${{ steps.release.outputs.releases_created }} |
| 25 | uses: eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8 |
| 26 | with: |
| 27 | version: '0.44.0' |
| 28 | enable-cache: true |
| 29 | |
| 30 | - name: Publish to PyPI |
| 31 | if: ${{ steps.release.outputs.releases_created }} |
| 32 | run: | |
| 33 | bash ./bin/publish-pypi |
| 34 | env: |
| 35 | PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }} |