Skip to content

Commit 5f851d6

Browse files
authored
Core rework of VRChat C# SDK (#30)
* upgrade to .NET 8.0 and switch to HttpClient * adjust the patches to account for new generator * make some changes * manual workflow to get new generated code * some ci changes * i really want to swear in this commit message * Upgrade C# SDK to spec 1.20.5 * okay everything here is done, now time to merge and then fix final stuff * Upgrade C# SDK to spec 1.20.5 * one fix and example projects * and a bug * Upgrade C# SDK to spec 1.20.5 * working on stuff * Upgrade C# SDK to spec 1.20.5 * god this is annoying * Upgrade C# SDK to spec 1.20.5 * the namespace was being overridden by the new classes * Upgrade C# SDK to spec 1.20.5 * do some magic tbh * Upgrade C# SDK to spec 1.20.5 * adjust for the new type * Upgrade C# SDK to spec 1.20.5 * stupid unauthorized mistake * Upgrade C# SDK to spec 1.20.5 * i accidentially wrote to the generated code * Upgrade C# SDK to spec 1.20.5 * generate patches * Upgrade C# SDK to spec 1.20.5 * more patches * Upgrade C# SDK to spec 1.20.5 * fixes and quirks * update readme mostly * typo * mistake * vrchat login fixes * Delete api directory * generate.sh changes * Upgrade C# SDK to spec 1.20.5 * clean up examples * fix generator * Delete api directory * update readme * Upgrade C# SDK to spec 1.20.5 * Delete api directory * some changes to the nuget package * CI to extensions hosting package and version to 2.0.0 * remove uncessary generated files, update CI, and rename all references to C# to .NET * update generate.sh with automatic version numbers * update generate.sh, ci, and etc to be working * update docs * update default example * Update ci.yaml * Upgrade .NET SDK to spec * fixes to CI * Upgrade .NET SDK to spec * final fix to CI * update readme one more time * fix readme * fix examples and client * Upgrade .NET SDK to spec 2.20.5 * this might fix it * Upgrade .NET SDK to spec 2.20.5 * Update generate.sh * update .net readme * update .net readme * fix * update icons and ci * Upgrade .NET SDK to spec 2.20.5 * fix generate.sh * fix generate.sh again * fix generate.sh AGAIN * Upgrade .NET SDK to spec 2.20.5 * fix generate.sh ONE MORE TIME * Upgrade .NET SDK to spec 2.20.5 * Upgrade .NET SDK to spec 2.20.5 * fix useragent * Upgrade .NET SDK to spec 2.20.5 * update useragents * fix version one more time * done * remove #520 patch --------- Co-authored-by: binn <binn@users.noreply.github.com>
1 parent 713a215 commit 5f851d6

File tree

577 files changed

+11433
-41940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

577 files changed

+11433
-41940
lines changed

.github/workflows/ci.yaml

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,78 @@
11
on:
22
repository_dispatch:
33
types: [spec_release]
4+
workflow_dispatch:
45

56
#on: push
67

78
name: Generate VRChat API SDK
89

910
jobs:
1011
generate:
11-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-latest
1213
name: Generate VRChat API SDK
1314
steps:
15+
- name: Install yq via apt
16+
run: sudo apt install -y yq
17+
1418
- uses: actions/setup-node@v3
1519
with:
16-
node-version: 16
20+
node-version: 18
21+
1722
- uses: actions/checkout@v3
1823
- name: 'Cache node_modules'
1924
uses: actions/cache@v3
2025
with:
2126
path: node_modules
22-
key: ${{ runner.os }}-node-v16-${{ hashFiles('**/generate.sh') }}
27+
key: ${{ runner.os }}-node-v18-${{ hashFiles('**/generate.sh') }}
2328
restore-keys: |
24-
${{ runner.os }}-node-v16
29+
${{ runner.os }}-node-v18
30+
2531
- name: Install OpenAPI Generator CLI
2632
run: npm install @openapitools/openapi-generator-cli
33+
2734
- name: Set OpenAPI Generator version
28-
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 6.2.1
35+
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 7.17.0
36+
2937
- name: Setup NuGet
3038
uses: NuGet/setup-nuget@v1.1.1
39+
3140
- uses: actions/setup-dotnet@v3
3241
with:
33-
dotnet-version: '5.0.x'
42+
dotnet-version: '8.0.x'
43+
3444
- name: Generate SDK Client
3545
run: bash ./generate.sh
46+
3647
- name: Copy README.md into src/
3748
run: cp README.md src/
49+
3850
- name: Check version number
3951
run: |
40-
echo "spec_version=$(grep "version of the OpenAPI document" src/VRChat.API/Model/User.cs | cut -d " " -f 9)" >> $GITHUB_ENV
52+
vrchat_sdk_version=$(yq '.info.version' openapi.yaml | tr -d '"')
53+
54+
major=$(echo $vrchat_sdk_version | cut -d. -f1)
55+
minor=$(echo $vrchat_sdk_version | cut -d. -f2)
56+
patch=$(echo $vrchat_sdk_version | cut -d. -f3)
57+
58+
vrchat_sdk_version="$((major+1)).$minor.$patch"
59+
echo "vrchat_sdk_version=$vrchat_sdk_version" >> $GITHUB_ENV
60+
4161
- name: Print version number
42-
run: echo ${{ env.spec_version }}
62+
run: echo ${{ env.vrchat_sdk_version }}
63+
64+
- name: Delete openapi.yaml file
65+
run: rm openapi.yaml
66+
4367
- name: Deploy SDK back into main branch
4468
uses: JamesIves/github-pages-deploy-action@v4
4569
with:
4670
branch: main
4771
folder: .
48-
commit-message: "Upgrade C# SDK to spec ${{ env.spec_version }}"
49-
- name: Publish to NuGet
72+
commit-message: "Upgrade .NET SDK to spec ${{ env.vrchat_sdk_version }}"
73+
74+
- name: Publish to VRChat.API to NuGet
75+
if: github.event_name != 'workflow_dispatch'
5076
uses: pairbit/publish-nuget@v2.5.8
5177
with:
5278
# Filepath of the project to be packaged, relative to root of repository
@@ -59,3 +85,18 @@ jobs:
5985
# NUGET_SOURCE: https://api.nuget.org
6086
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
6187
INCLUDE_SYMBOLS: true
88+
89+
- name: Publish to VRChat.API.Extensions.Hosting to NuGet
90+
if: github.event_name != 'workflow_dispatch'
91+
uses: pairbit/publish-nuget@v2.5.8
92+
with:
93+
# Filepath of the project to be packaged, relative to root of repository
94+
PROJECT_FILE_PATH: wrapper/VRChat.API.Extensions.Hosting/VRChat.API.Extensions.Hosting.csproj
95+
# NuGet package id, used for version detection & defaults to project name
96+
PACKAGE_NAME: VRChat.API.Extensions.Hosting
97+
# API key to authenticate with NuGet server
98+
NUGET_KEY: ${{secrets.NUGET_KEY}}
99+
# NuGet server uri hosting the packages, defaults to https://api.nuget.org
100+
# NUGET_SOURCE: https://api.nuget.org
101+
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
102+
INCLUDE_SYMBOLS: true

.openapi-generator-ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Use this file to prevent files from being overwritten by the generator.
55
# The patterns follow closely to .gitignore or .dockerignore.
66

7-
# As an example, the C# client generator defines ApiClient.cs.
7+
# As an example, the .NET client generator defines ApiClient.cs.
88
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
99
#ApiClient.cs
1010

.openapi-generator/FILES

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.gitignore
2+
api/openapi.yaml
23
appveyor.yml
34
docs/APIConfig.md
45
docs/APIConfigAccessLogsUrls.md
@@ -288,8 +289,8 @@ src/VRChat.API/Client/ApiResponse.cs
288289
src/VRChat.API/Client/ClientUtils.cs
289290
src/VRChat.API/Client/Configuration.cs
290291
src/VRChat.API/Client/ExceptionFactory.cs
292+
src/VRChat.API/Client/FileParameter.cs
291293
src/VRChat.API/Client/GlobalConfiguration.cs
292-
src/VRChat.API/Client/HttpMethod.cs
293294
src/VRChat.API/Client/IApiAccessor.cs
294295
src/VRChat.API/Client/IAsynchronousClient.cs
295296
src/VRChat.API/Client/IReadableConfiguration.cs
@@ -298,6 +299,7 @@ src/VRChat.API/Client/Multimap.cs
298299
src/VRChat.API/Client/OpenAPIDateConverter.cs
299300
src/VRChat.API/Client/RequestOptions.cs
300301
src/VRChat.API/Client/RetryConfiguration.cs
302+
src/VRChat.API/Client/WebRequestPathBuilder.cs
301303
src/VRChat.API/Model/APIConfig.cs
302304
src/VRChat.API/Model/APIConfigAccessLogsUrls.cs
303305
src/VRChat.API/Model/APIConfigAnnouncement.cs

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.2.1
1+
7.17.0

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)