Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8e11013
ci: update actions to their current major versions
ariesclark Aug 9, 2026
d153a9f
ci: build from a supplied spec on push, pull request, or call
ariesclark Aug 9, 2026
20e888d
ci: generate from the legacy bundle this SDK ships from
ariesclark Aug 9, 2026
ef105c1
ci: build against the bundle this SDK generates from
ariesclark Aug 9, 2026
093581b
ci: let setup decide where the bundle comes from
ariesclark Aug 9, 2026
7d13101
ci: run the generator from its jar instead of an npm wrapper
ariesclark Aug 9, 2026
5b535b2
ci: use the renamed setup-generator and download actions
ariesclark Aug 9, 2026
a924667
ci: split the checks into their own jobs and separate release
ariesclark Aug 9, 2026
066f10f
ci: give generation its own job ahead of the checks
ariesclark Aug 9, 2026
710119e
ci: run the checks once per change
ariesclark Aug 9, 2026
2bf5297
ci: run the checks on every branch
ariesclark Aug 9, 2026
e02dd92
ci: report how to install what this run built
ariesclark Aug 9, 2026
b09f17c
ci: report how to install what this run built
ariesclark Aug 9, 2026
c7bc571
ci: let each SDK report itself
ariesclark Aug 9, 2026
4279e02
ci: publish from the ci workflow
ariesclark Aug 9, 2026
9c14508
fix(ci): only publish from the SDK's own repository
ariesclark Aug 9, 2026
be603a6
ci: use the actions from the specification's main branch
ariesclark Aug 9, 2026
4d5c765
Merge remote-tracking branch 'origin/main' into ci/modernise-actions
ariesclark Aug 9, 2026
dd5e4e1
Merge remote-tracking branch 'origin/main' into ci/modernise-actions
ariesclark Aug 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 83 additions & 66 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,112 +1,129 @@
on:
push:
branches:
- '**'
pull_request:
repository_dispatch:
types: [release]
workflow_dispatch:
inputs:
json:
description: 'Passed json from repository_dispatch'
description: Passed json from repository_dispatch
required: true
type: string
version_postfix:
description: 'Additional string to concatenate onto the existing version before release'
description: Additional string to concatenate onto the existing version before release
required: false
type: string
default: ''
workflow_call:
inputs:
ref:
description: Ref of this repository to build.
required: false
type: string
default: main

name: Generate VRChat API SDK
name: CI

env:
PASSED_VERSION: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json || '{}'))['version'] }}
VERSION_POSTPEND: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix || '' }}
Comment on lines +29 to +31

jobs:
generate:
runs-on: ubuntu-latest
name: Generate VRChat API SDK
env:
ARTIFACT_NAME: "openapi.yaml"
INPUT: ${{ github.event_name == 'repository_dispatch' && toJSON(github.event.client_payload) || inputs.json }}
SPEC_URL: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json))['artifacts']['openapi-legacy.yaml'] }}
PASSED_VERSION: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json))['version'] }}
VERSION_POSTPEND: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix || '' }}
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/setup-node@v4
- uses: actions/checkout@v7
with:
node-version: 22
repository: vrchatapi/vrchatapi-csharp
ref: ${{ inputs.ref || github.ref }}
Comment on lines +39 to +42

- uses: vrchatapi/specification/.github/actions/setup-generator@main

- uses: actions/checkout@v4
- name: 'Cache node_modules'
uses: actions/cache@v4
- uses: vrchatapi/specification/.github/actions/download@main
with:
path: node_modules
key: ${{ runner.os }}-node-v22-${{ hashFiles('**/generate.sh') }}
restore-keys: |
${{ runner.os }}-node-v22
bundle: openapi-legacy.yaml
Comment on lines +44 to +48

- name: Install OpenAPI Generator CLI
run: npm install @openapitools/openapi-generator-cli
# The SDK is a major version ahead of the specification.
- id: version
run: |
version="${PASSED_VERSION:-$(yq -r '.info.version' openapi-legacy.yaml)}"
version="$(( ${version%%.*} + 1 )).${version#*.}${VERSION_POSTPEND}"

- name: Set OpenAPI Generator version
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 7.17.0
echo "version=${version}" >> $GITHUB_OUTPUT

- if: env.VERSION_POSTPEND != ''
run: yq '--inplace' ".info.version |= \"${{ steps.version.outputs.version }}\"" openapi-legacy.yaml

- run: bash ./generate.sh openapi-legacy.yaml "${{ steps.version.outputs.version }}"

- run: cp README.md src/

- uses: actions/upload-artifact@v7
with:
name: csharp-generated
path: .
include-hidden-files: true
Comment on lines +65 to +69

- name: Setup NuGet
uses: NuGet/setup-nuget@v1.1.1
build:
needs: generate
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
name: csharp-generated

- uses: actions/setup-dotnet@v5
- uses: actions/setup-dotnet@v6
with:
dotnet-version: '8.0.x'

- name: Download Specification
run: wget "${SPEC_URL}" '--output-document' "${ARTIFACT_NAME}"
- run: dotnet build VRChat.API.sln --configuration Release

- name: Check version number
run: |
vrchat_sdk_version=$(( ${PASSED_VERSION%%.*} + 1)).${PASSED_VERSION#*.}${VERSION_POSTPEND}
echo "Version is: ${vrchat_sdk_version}"
echo "vrchat_sdk_version=$vrchat_sdk_version" >> $GITHUB_ENV
publish:
needs:
- generate
- build
if: github.repository == 'vrchatapi/vrchatapi-csharp'
&& (github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
repository: vrchatapi/vrchatapi-csharp

- name: Apply Version Postpend
if: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix != '' }}
run: yq '--inplace' ".info.version |= \"${vrchat_sdk_version}\"" "${ARTIFACT_NAME}"
- uses: actions/download-artifact@v8
with:
name: csharp-generated

- name: Generate SDK Client
run: bash ./generate.sh "${ARTIFACT_NAME}" "${vrchat_sdk_version}"
- run: rm -f openapi-legacy.yaml

- name: Copy README.md into src/
run: cp README.md src/
- uses: NuGet/setup-nuget@v4.0

- name: Delete openapi.json file
run: unlink ${ARTIFACT_NAME}
- uses: actions/setup-dotnet@v6
with:
dotnet-version: '8.0.x'

- name: Deploy SDK back into main branch
uses: JamesIves/github-pages-deploy-action@v4
- uses: JamesIves/github-pages-deploy-action@v4.9.0
with:
branch: main
folder: .
commit-message: "Upgrade .NET SDK to spec ${{ env.vrchat_sdk_version }}"
commit-message: Upgrade .NET SDK to spec ${{ needs.generate.outputs.version }}

- name: Publish to VRChat.API to NuGet
if: github.event_name == 'repository_dispatch'
uses: pairbit/publish-nuget@v2.5.8
- if: github.event_name == 'repository_dispatch'
uses: pairbit/publish-nuget@v2.6.2
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
NUGET_KEY: ${{ secrets.NUGET_KEY }}
INCLUDE_SYMBOLS: true

- name: Publish to VRChat.API.Extensions.Hosting to NuGet
if: github.event_name == 'repository_dispatch'
uses: pairbit/publish-nuget@v2.5.8

- if: github.event_name == 'repository_dispatch'
uses: pairbit/publish-nuget@v2.6.2
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: wrapper/VRChat.API.Extensions.Hosting/VRChat.API.Extensions.Hosting.csproj
# NuGet package id, used for version detection & defaults to project name
PACKAGE_NAME: VRChat.API.Extensions.Hosting
# 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
NUGET_KEY: ${{ secrets.NUGET_KEY }}
INCLUDE_SYMBOLS: true
8 changes: 4 additions & 4 deletions .github/workflows/realtime-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
name: Build and Publish VRChat Realtime SDK
steps:
- name: Checkout current commit
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0 # Fetch all history to compare versions

- name: Setup .NET
uses: actions/setup-dotnet@v5
uses: actions/setup-dotnet@v6
with:
dotnet-version: '8.0.x'

- name: Setup NuGet
uses: NuGet/setup-nuget@v1.1.1
uses: NuGet/setup-nuget@v4.0

- name: Get current version from csproj
id: current_version
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:

- name: Publish to NuGet
if: steps.version_check.outputs.changed == 'true'
uses: pairbit/publish-nuget@v2.5.8
uses: pairbit/publish-nuget@v2.6.2
with:
PROJECT_FILE_PATH: wrapper/VRChat.API.Realtime/VRChat.API.Realtime.csproj
PACKAGE_NAME: VRChat.API.Realtime
Expand Down
2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi

rm src docs *.nupkg *.snupkg -rf

./node_modules/\@openapitools/openapi-generator-cli/main.js generate \
openapi-generator generate \
-g csharp \
Comment on lines 9 to 12
-t ./templates \
--library httpclient \
Expand Down
1 change: 0 additions & 1 deletion openapitools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.17.0"
Expand Down
Loading
Loading