-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.09 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Generate API Client
on:
push:
branches:
- main
jobs:
generate-api-client:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Generate API Client
env:
OPEN_API_FILE_PATH: "./swagger.json"
OPEN_API_GENERATE_CONFIG: "./advancer_api_client.config.json"
OPEN_API_GENERATE_DIRECTORY: "./api_client"
run: |
npx openapi-generator-cli generate -i "$OPEN_API_FILE_PATH" -g typescript-axios -c "$OPEN_API_GENERATE_CONFIG" -o "$OPEN_API_GENERATE_DIRECTORY" -t "./typescript_generator_templates"
cd "$OPEN_API_GENERATE_DIRECTORY"
npm i axios@latest
npm i -D @types/node@latest typescript@latest
npm run build
- name: Commit Generated Code
run: |
git config numanbtt "GitHub Actions"
git config numanbtt@gmail.com "actions@github.com"
git add ./api_client
git commit -m "Update generated API client"
git push