openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
.github/workflows/publish-pypi.yml
31lines · modecode
| 1 | # This workflow is triggered when a GitHub release is created. |
| 2 | # It can also be run manually to re-publish to PyPI in case it failed for some reason. |
| 3 | # You can run this workflow by navigating to https://www.github.com/openai/openai-python/actions/workflows/publish-pypi.yml |
| 4 | name: Publish PyPI |
| 5 | on: |
| 6 | workflow_dispatch: |
| 7 | |
| 8 | release: |
| 9 | types: [published] |
| 10 | |
| 11 | jobs: |
| 12 | publish: |
| 13 | name: publish |
| 14 | runs-on: ubuntu-latest |
| 15 | |
| 16 | steps: |
| 17 | - uses: actions/checkout@v3 |
| 18 | |
| 19 | - name: Install Rye |
| 20 | run: | |
| 21 | curl -sSf https://rye-up.com/get | bash |
| 22 | echo "$HOME/.rye/shims" >> $GITHUB_PATH |
| 23 | env: |
| 24 | RYE_VERSION: 0.15.2 |
| 25 | RYE_INSTALL_OPTION: "--yes" |
| 26 | |
| 27 | - name: Publish to PyPI |
| 28 | run: | |
| 29 | bash ./bin/publish-pypi |
| 30 | env: |
| 31 | PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }} |
| 32 | |