Skip to content

spec_release

spec_release #101

Workflow file for this run

on:
repository_dispatch:
types: [spec_release]
#on: push
name: Generate VRChat API SDK
jobs:
generate:
runs-on: ubuntu-latest
name: Generate VRChat API SDK
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v3
- name: 'Cache node_modules'
uses: actions/cache@v3
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: Setup NuGet
uses: NuGet/[email protected]
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
- name: Generate SDK Client
run: bash ./generate.sh
- name: Copy README.md into src/
run: cp README.md src/
- name: Check version number
run: |
echo "spec_version=$(grep "version of the OpenAPI document" src/VRChat.API/Model/User.cs | cut -d " " -f 9)" >> $GITHUB_ENV
- name: Print version number
run: echo ${{ env.spec_version }}
- name: Deploy SDK back into main branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: main
folder: .
commit-message: "Upgrade C# SDK to spec ${{ env.spec_version }}"
- name: Publish to NuGet
uses: pairbit/[email protected]
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: src/VRChat.API/VRChat.API.csproj
# NuGet package id, used for version detection & defaults to project name
PACKAGE_NAME: VRChat.API
# API key to authenticate with NuGet server
NUGET_KEY: ${{secrets.NUGET_KEY}}
# NuGet server uri hosting the packages, defaults to https://api.nuget.org
# NUGET_SOURCE: https://api.nuget.org
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
INCLUDE_SYMBOLS: true