Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions .github/workflows/sdk_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ jobs:
needs: [publish]
runs-on: ubuntu-latest
steps:
- name: Generate docs dispatch bot token
id: docs-app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.SDK_DISPATCH_APP_ID }}
private-key: ${{ secrets.SDK_DISPATCH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: demo2
permission-contents: write
permission-pull-requests: write

- name: Checkout Python SDK
uses: actions/checkout@v4
with:
Expand All @@ -35,26 +46,13 @@ jobs:
uses: actions/checkout@v4
with:
repository: TextQLLabs/demo2
token: ${{ secrets.GH_PAT }}
token: ${{ steps.docs-app-token.outputs.token }}
path: demo2

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Snapshot combined OpenAPI with SDK samples
run: |
curl --fail --silent --show-error --location \
--header 'Cache-Control: no-cache' \
--retry 10 --retry-all-errors --retry-delay 10 \
https://spec.speakeasy.com/textql/home/textql-api-with-code-samples \
--output demo2/docs/public/api-reference/speakeasy/textql-api-with-code-samples.yaml

- name: Render Mintlify API reference
run: |
python3 -m pip install --disable-pip-version-check PyYAML==6.0.3
python3 demo2/scripts/render_sdk_api_reference.py

- name: Render Mintlify release log
run: |
python3 sdk/scripts/render_mintlify_releases.py \
Expand All @@ -65,23 +63,24 @@ jobs:
id: docs-pr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_PAT }}
token: ${{ steps.docs-app-token.outputs.token }}
path: demo2
add-paths: |
docs/public/api-reference/sdk/changelog.mdx
branch: automation/python-sdk-docs
delete-branch: true
commit-message: "docs: sync Python SDK reference"
title: "docs: sync Python SDK reference"
body: |
Automated after a successful Python SDK publish.

- Snapshots the combined Speakeasy OpenAPI document and SDK code samples.
- Regenerates stable Mintlify API-reference wrappers.
- Updates the Python SDK release log from `TextQLLabs/textql-python-v3/RELEASES.md`.
- Shared OpenAPI, code-sample, wrapper, and navigation files are owned by the TypeScript docs sync to avoid competing generated PRs.

- name: Auto-merge docs pull request after checks pass
if: steps.docs-pr.outputs.pull-request-number != ''
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
GH_TOKEN: ${{ steps.docs-app-token.outputs.token }}
DOCS_PR_NUMBER: ${{ steps.docs-pr.outputs.pull-request-number }}
run: |
gh pr merge "$DOCS_PR_NUMBER" \
Expand Down