Skip to content

Commit cd0a733

Browse files
committed
add python
1 parent c1f691f commit cd0a733

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows/autogen-remote-changes.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,35 @@ on: [push, pull_request]
1010
jobs:
1111
update-sdk:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.11"]
1316
steps:
1417
- name: Checkout repository
1518
run: |
1619
git clone https://github.com/${{ github.repository }} repo
1720
cd repo
1821
git config --global user.name "github-actions[bot]"
1922
git config --global user.email "github-actions[bot]@users.noreply.github.com"
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: '18'
31+
- name: Install OpenAPI Generator CLI
32+
run: npm install @openapitools/openapi-generator-cli -g
33+
- name: Install dependencies
34+
run: |
35+
cd repo
36+
python -m pip install --upgrade pip
37+
pip install -r requirements.txt
2038
- name: Pull and generate SDK
2139
run: |
2240
cd repo
23-
make gen-openapi-remote
41+
make gen-openapi-remote-for-ci
2442
- name: Check for changes
2543
run: |
2644
cd repo
@@ -49,7 +67,7 @@ jobs:
4967
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5068
run: |
5169
PR_TITLE="Auto-update SDK on $(date +'%Y-%m-%d')"
52-
PR_BODY="This pull request was automatically created by GitHub Actions to update the SDK."
70+
PR_BODY="This pull request was automatically created by GitHub Actions to update the SDK with the latest remote OpenAPI specification."
5371
curl -H "Authorization: token $GITHUB_TOKEN" \
5472
-X POST \
5573
-H "Content-Type: application/json" \

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ SHELL:=/bin/bash
22
PYTHON_POST_PROCESS_FILE=python -m black
33

44
OPENAPI_GEN=openapi-generator generate --enable-post-process-file -i api/openapi.yaml -g python -o . -c config.json -t .openapi-generator/templates
5+
OPENAPI_GEN_CI=openapi-generator-cli generate --enable-post-process-file -i api/openapi.yaml -g python -o . -c config.json -t .openapi-generator/templates
56

67
gen-openapi:
78
$(OPENAPI_GEN)
89
gen-openapi-remote:
910
curl https://app.opal.dev/openapi.yaml > api/openapi.yaml
10-
$(OPENAPI_GEN)
11+
$(OPENAPI_GEN)
12+
gen-openapi-remote-for-ci:
13+
curl https://app.opal.dev/openapi.yaml > api/openapi.yaml
14+
$(OPENAPI_GEN_CI)

0 commit comments

Comments
 (0)