1+ name : Generate SDK references
2+
3+ on :
4+ workflow_dispatch :
5+ workflow_call :
6+ # Remove after testing
7+ push :
8+ branches :
9+ - improved-api-refs
10+
11+ concurrency : ${{ github.workflow }}-${{ github.ref }}
12+
13+ permissions :
14+ contents : write
15+
16+ jobs :
17+ is_new_sdk_ref :
18+ name : Is new SDK reference?
19+ runs-on : ubuntu-latest
20+ outputs :
21+ new_sdk_ref : ${{ steps.sdk-changes.outputs.new_sdk_ref }}
22+ steps :
23+ - name : Checkout Repo
24+ uses : actions/checkout@v3
25+ with :
26+ fetch-depth : 2
27+
28+ - name : Check if SDK changes
29+ id : sdk-changes
30+ run : |
31+ IS_NEW_sdk_REF=$(./.github/scripts/is_new_sdk_ref.sh)
32+ echo "new_sdk_ref=$IS_NEW_sdk_REF" >> "$GITHUB_OUTPUT"
33+
34+ sdk-changes :
35+ name : SDK changes
36+ runs-on : ubuntu-latest
37+ steps :
38+ - name : Checkout repository
39+ uses : actions/checkout@v3
40+ with :
41+ fetch-depth : 0
42+
43+ - name : Install pnpm
44+ uses : pnpm/action-setup@v3
45+ id : pnpm-install
46+ with :
47+ version : 9.5
48+
49+ - name : Setup Node
50+ uses : actions/setup-node@v3
51+ with :
52+ node-version : " 20.x"
53+ registry-url : " https://registry.npmjs.org"
54+ cache : pnpm
55+ cache-dependency-path : pnpm-lock.yaml
56+
57+ - name : Configure pnpm
58+ run : |
59+ pnpm config set auto-install-peers true
60+ pnpm config set exclude-links-from-lockfile true
61+
62+ - name : Install dependencies
63+ run : pnpm install --frozen-lockfile
64+
65+ - name : Set up Python
66+ id : setup-python
67+ uses : actions/setup-python@v5
68+ with :
69+ python-version : " 3.8"
70+
71+ - name : Install and configure Poetry
72+ uses : snok/install-poetry@v1
73+ with :
74+ version : 1.5.1
75+ virtualenvs-create : true
76+ virtualenvs-in-project : true
77+ installer-parallel : true
78+
79+ - name : Install dependencies
80+ working-directory : ./packages/python-sdk
81+ run : poetry install --no-interaction --no-root
82+
83+ - name : Generate Python SDK reference
84+ id : python-sdk-ref
85+ working-directory : ./python
86+ run : |
87+ source .venv/bin/activate
88+ ./scripts/generate_sdk_ref.sh
89+
90+ - name : Generate JS SDK reference
91+ id : js-sdk-ref
92+ working-directory : ./js
93+ run : ./scripts/generate_sdk_ref.sh
94+
95+ - name : Show docs file structure
96+ run : tree apps/web/src/app/\(docs\)/docs/sdk-reference
97+
98+ - name : Commit new SDK reference versions
99+ env :
100+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101+ run : |
102+ git config user.name "github-actions[bot]"
103+ git config user.email "github-actions[bot]@users.noreply.github.com"
104+ git add ./sdk-reference
105+ git commit -m "[skip ci] Release new SDK reference doc versions" || exit 0
106+ git push
0 commit comments