| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f504384 commit 63222f6
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,39 @@ | |||
| 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@v3 | ||
| 18 | + | ||
| 19 | + - uses: stainless-api/trigger-release-please@v1 | ||
| 20 | + id: release | ||
| 21 | + with: | ||
| 22 | + repo: ${{ github.event.repository.full_name }} | ||
| 23 | + stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} | ||
| 24 | + | ||
| 25 | + - name: Install Rye | ||
| 26 | + if: ${{ steps.release.outputs.releases_created }} | ||
| 27 | + run: | | ||
| 28 | + curl -sSf https://rye-up.com/get | bash | ||
| 29 | + echo "$HOME/.rye/shims" >> $GITHUB_PATH | ||
| 30 | + env: | ||
| 31 | + RYE_VERSION: 0.24.0 | ||
| 32 | + RYE_INSTALL_OPTION: "--yes" | ||
| 33 | + | ||
| 34 | + - name: Publish to PyPI | ||
| 35 | + if: ${{ steps.release.outputs.releases_created }} | ||
| 36 | + run: | | ||
| 37 | + bash ./bin/publish-pypi | ||
| 38 | + env: | ||
| 39 | + PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,9 @@ | |||
| 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 | ||
| 1 | + # workflow for re-running publishing to PyPI in case it fails for some reason | ||
| 2 | + # you can run this workflow by navigating to https://www.github.com/openai/openai-python/actions/workflows/publish-pypi.yml | ||
| 4 | 3 | name: Publish PyPI | |
| 5 | 4 | on: | |
| 6 | 5 | workflow_dispatch: | |
| 7 | 6 | ||
| 8 | - release: | ||
| 9 | - types: [published] | ||
| 10 | - | ||
| 11 | 7 | jobs: | |
| 12 | 8 | publish: | |
| 13 | 9 | name: publish | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,4 +19,5 @@ jobs: | |||
| 19 | 19 | run: | | |
| 20 | 20 | bash ./bin/check-release-environment | |
| 21 | 21 | env: | |
| 22 | + STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} | ||
| 22 | 23 | PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | 3 | errors=() | |
| 4 | 4 | ||
| 5 | + if [ -z "${STAINLESS_API_KEY}" ]; then | ||
| 6 | + errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") | ||
| 7 | + fi | ||
| 8 | + | ||
| 5 | 9 | if [ -z "${PYPI_TOKEN}" ]; then | |
| 6 | 10 | errors+=("The OPENAI_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") | |
| 7 | 11 | fi | |
| Back | FazBrowse Home | New Git URL |
0 commit comments