Skip to content

chore: remove unused dependencies and pin build tooling (#3650) #1280

chore: remove unused dependencies and pin build tooling (#3650)

chore: remove unused dependencies and pin build tooling (#3650) #1280

name: Create releases
on:
push:
branches:
- main
jobs:
release:
name: release
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-python'
runs-on: ubuntu-latest
environment: release
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
permissions: {}
steps:
- name: Create release app token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.OPENAI_SDKS_APP_CLIENT_ID }}
private-key: ${{ secrets.OPENAI_SDKS_APP_PRIVATE_KEY }}
permission-contents: write
permission-issues: write
permission-pull-requests: write
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release
with:
token: ${{ steps.app-token.outputs.token }}
target-branch: main
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
build:
name: build
needs: release
if: ${{ needs.release.outputs.releases_created == 'true' }}
runs-on: ubuntu-latest
# Build distributions without OIDC access so package build code cannot mint
# a PyPI publishing token. The publish job handles only the upload.
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set up Rye
uses: eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8
with:
version: '0.44.0'
enable-cache: true
- name: Build package
run: |
mkdir -p dist
rye build --clean
- name: Upload package distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: python-package-distributions
path: dist/
if-no-files-found: error
retention-days: 1
publish:
name: publish
needs: build
runs-on: ubuntu-latest
environment: publish
# PyPI Trusted Publishing requires id-token: write. Keep it scoped to this
# minimal upload-only job rather than the build job.
permissions:
id-token: write
steps:
- name: Download package distributions
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0