-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.44 KB
/
ts-axios.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: typescript-axios
on:
push:
branches:
- main
paths:
- 'zerotierone-openapi.yaml'
workflow_dispatch:
jobs:
main:
name: Generate, build and publish
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.*
registry-url: 'https://registry.npmjs.org'
- name: Setup openapi-generator-cli
run: |
npm install @openapitools/openapi-generator-cli -g
- name: Generate
run: |
npx openapi-generator-cli generate \
-i zerotierone-openapi.yaml \
-g typescript-axios \
-o zerotierone-api-ts-axios \
--additional-properties=npmName=zerotierone-api-ts-axios \
--git-user-id JohnGuan \
--git-repo-id zerotierone-openapi
cat << EOF | cat - zerotierone-api-ts-axios/README.md > temp && mv temp zerotierone-api-ts-axios/README.md
> 📄 This document is auto-generated. For detailed information, please refer to the [GitHub repo](https://github.com/JohnGuan/zerotierone-openapi).
EOF
- name: Build
run: |
npm install
npm run build
working-directory: zerotierone-api-ts-axios
- name: Publish
run: |
npm publish
working-directory: zerotierone-api-ts-axios
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}