This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
update-ai-openapi #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update AI SDKs | |
on: | |
repository_dispatch: | |
types: [update-ai-openapi] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-ai-sdks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main repository | |
uses: actions/checkout@v4 | |
# Add this step to set up Node.js and npm with caching | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Checkout ai-worker repository | |
uses: actions/checkout@v4 | |
with: | |
repository: "livepeer/ai-worker" | |
path: "ai-worker" | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ai-worker/runner/requirements.txt | |
- name: Generate AI OpenAPI specification | |
working-directory: ai-worker/runner | |
run: | | |
python gen_openapi.py --entrypoint gateway | |
mv openapi_gateway.json $GITHUB_WORKSPACE/openapi_ai_gateway.json | |
- name: Generate AI SDKs | |
run: | | |
bash scripts/gen_client_sdks.bash | |
- name: Commit OpenAPI spec and create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
add-paths: | | |
openapi_ai_gateway.json | |
sdks/* | |
commit-message: "chore: update AI SDKs" | |
title: "Automated AI SDKs update" | |
body: | | |
This is an automated pull request to update the AI SDKs due to changes in the AI Worker OpenAPI specification (upstream commit [${{github.event.client_payload.sha}}](https://livepeer/ai-worker/commit/${{github.event.client_payload.sha}})). | |
branch: "update-openapi-spec" | |
base: "main" | |
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |