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 | 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 | outputs: |
| 13 | releases_created: ${{ steps.release.outputs.releases_created }} |
| 14 | |
| 15 | steps: |
| 16 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 17 | |
| 18 | - uses: stainless-api/trigger-release-please@bb6677c5a04578eec1ccfd9e1913b5b78ed64c61 # v1.4.0 |
| 19 | id: release |
| 20 | with: |
| 21 | repo: ${{ github.event.repository.full_name }} |
| 22 | stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} |
| 23 | |
| 24 | publish: |
| 25 | name: publish |
| 26 | needs: release |
| 27 | if: ${{ needs.release.outputs.releases_created == 'true' }} |
| 28 | runs-on: ubuntu-latest |
| 29 | environment: publish |
| 30 | |
| 31 | steps: |
| 32 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 33 | |
| 34 | - name: Set up Rye |
| 35 | uses: eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8 |
| 36 | with: |
| 37 | version: '0.44.0' |
| 38 | enable-cache: true |
| 39 | |
| 40 | - name: Publish to PyPI |
| 41 | run: | |
| 42 | bash ./bin/publish-pypi |
| 43 | env: |
| 44 | PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }} |
| 45 | |