openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
.github/workflows/create-releases.yml
37lines · 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@v3 |
| 16 | |
| 17 | - uses: stainless-api/trigger-release-please@v1 |
| 18 | id: release |
| 19 | with: |
| 20 | repo: ${{ github.event.repository.full_name }} |
| 21 | stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} |
| 22 | |
| 23 | - name: Install Rye |
| 24 | if: ${{ steps.release.outputs.releases_created }} |
| 25 | run: | |
| 26 | curl -sSf https://rye-up.com/get | bash |
| 27 | echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 28 | env: |
| 29 | RYE_VERSION: 0.15.2 |
| 30 | RYE_INSTALL_OPTION: "--yes" |
| 31 | |
| 32 | - name: Publish to PyPI |
| 33 | if: ${{ steps.release.outputs.releases_created }} |
| 34 | run: | |
| 35 | bash ./bin/publish-pypi |
| 36 | env: |
| 37 | PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }} |
| 38 | |