1+ # on:
2+ # repository_dispatch:
3+ # types: [spec_release]
4+ on : push
5+
6+ name : Generate VRChat API SDK
7+
8+ jobs :
9+ generate :
10+ runs-on : ubuntu-latest
11+ name : Generate VRChat API SDK
12+ steps :
13+ - uses : actions/setup-node@v1
14+ with :
15+ node-version : 16
16+ - uses : actions/checkout@v2
17+ - name : ' Cache node_modules'
18+ uses : actions/cache@v2
19+ with :
20+ path : node_modules
21+ key : ${{ runner.os }}-node-v16-${{ hashFiles('**/generate.sh') }}
22+ restore-keys : |
23+ ${{ runner.os }}-node-v16
24+ - name : Install OpenAPI Generator CLI
25+ run : npm install @openapitools/openapi-generator-cli
26+ - name : Set up Python 3.9
27+ uses : actions/setup-python@v1
28+ with :
29+ python-version : 3.9
30+ - name : Generate SDK Client
31+ run : bash ./generate.sh
32+ - name : Check version number
33+ run : |
34+ echo "spec_version=$(grep "version" ./package.json | cut -d "\"" -f 4)" >> $GITHUB_ENV
35+ - name : Print version number
36+ run : echo ${{ env.spec_version }}
37+ - name : Deploy SDK back into main branch
38+ uses : JamesIves/github-pages-deploy-action@4.1.5
39+ with :
40+ branch : main
41+ folder : .
42+ commit-message : " Upgrade Python SDK to spec ${{ env.spec_version }}"
43+ - name : Install pypa/build
44+ run : python -m pip install build --user
45+ - name : Build a binary wheel and a source tarball
46+ run : python -m build --sdist --wheel --outdir dist/ .
47+ - name : Publish SDK 📦 to PyPI
48+ uses : pypa/gh-action-pypi-publish@master
49+ with :
50+ password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments