spec_release #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
repository_dispatch: | |
types: [spec_release] | |
workflow_dispatch: | |
#on: push | |
name: Generate VRChat API SDK | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
name: Generate VRChat API SDK | |
steps: | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- uses: actions/checkout@v2 | |
- name: 'Cache node_modules' | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-v16-${{ hashFiles('**/generate.sh') }} | |
restore-keys: | | |
${{ runner.os }}-node-v16 | |
- name: Install OpenAPI Generator CLI | |
run: npm install @openapitools/openapi-generator-cli | |
- name: Set OpenAPI Generator version | |
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 6.2.1 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Generate SDK Client | |
run: bash ./generate.sh | |
- name: Check version number | |
run: | | |
echo "spec_version=$(grep "VERSION =" setup.py | cut -d "\"" -f 2)" >> $GITHUB_ENV | |
- name: Print version number | |
run: echo ${{ env.spec_version }} | |
- name: Deploy SDK back into main branch | |
uses: JamesIves/github-pages-deploy-action@4.1.5 | |
with: | |
branch: main | |
folder: . | |
commit-message: "Upgrade Python SDK to spec ${{ env.spec_version }}" | |
- name: Install pypa/build | |
run: python -m pip install build --user | |
- name: Build a binary wheel and a source tarball | |
run: python -m build --sdist --wheel --outdir dist/ . | |
- name: Publish SDK 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip_existing: true | |
password: ${{ secrets.PYPI_API_TOKEN }} |