Skip to content

Commit adc7409

Browse files
fix: correct order of package removal in VRChat CI workflow #minor
fix: correct package removal command in VRChat CI workflow #minor fix: comment out unused authentication cookies in VRChat CI workflow #minor Update vrchat-world-ci.yml
1 parent 3c62f3e commit adc7409

25 files changed

+796
-5
lines changed

.github/workflows/vrchat-world-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ jobs:
9494
vrc-get remove dev.foxscore.easy-login au.benjithatfoxguy.templates.world.2022.3.22f1.updater com.nidonocu.vrcunitytoolbar au.benjithatfoxguy.batchimportunitypackage au.benjithatfoxguy.restartunity dev.hai-vr.resilience.let-me-see dev.hai-vr.resilience.toolkit unity-editor-dark-mode -y
9595
vrc-get remove numeira.auto-certify-copyright-agreement -y
9696
97-
- name: Add AutoBuild Packages to Workspace
98-
if: runner.os == 'Linux'
99-
working-directory: ${{ env.workspace-path }}
100-
# run: vrc-get install com.yuxiaviation.vrchat.autobuild.world 0.3.0 -y
101-
run: vrc-get install com.yuxiaviation.vrchat.autobuild.world -y || true
97+
# - name: Add AutoBuild Packages to Workspace
98+
# if: runner.os == 'Linux'
99+
# working-directory: ${{ env.workspace-path }}
100+
# # run: vrc-get install com.yuxiaviation.vrchat.autobuild.world 0.3.0 -y
101+
# run: vrc-get install com.yuxiaviation.vrchat.autobuild.world -y || true
102102

103103
- name: Add AutoBuild Packages to Workspace
104104
if: runner.os == 'Windows'

Packages/com.yuxiaviation.vrchat.autobuild.world/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
using JetBrains.Annotations;
4+
using UnityEditor;
5+
using UnityEngine;
6+
using VRC.SDK3.Editor;
7+
using VRC.SDKBase.Editor.Api;
8+
9+
namespace VRChatAerospaceUniversity.VRChatAutoBuild.Worlds {
10+
internal static class AutoBuildVRChatWorld {
11+
[PublicAPI]
12+
private static async void BuildWorld() {
13+
try {
14+
await AutoBuildBase.InitAutoBuildAsync();
15+
}
16+
catch (Exception e) {
17+
AutoBuildBase.ExitWithException(e);
18+
return;
19+
}
20+
21+
AutoBuildLogger.BeginLogGroup("Build world");
22+
AutoBuildLogger.Log("Building world");
23+
try {
24+
await BuildAsync();
25+
}
26+
catch (Exception e) {
27+
AutoBuildBase.ExitWithException(e);
28+
return;
29+
}
30+
31+
AutoBuildLogger.Log("World build complete");
32+
AutoBuildLogger.EndLogGroup();
33+
EditorApplication.Exit(0);
34+
}
35+
36+
[PublicAPI]
37+
private static async void BuildAndUploadWorld() {
38+
AutoBuildArguments args;
39+
try {
40+
args = await AutoBuildBase.InitAutoBuildAsync();
41+
}
42+
catch (Exception e) {
43+
AutoBuildBase.ExitWithException(e);
44+
return;
45+
}
46+
47+
var worldId = args.ContentId;
48+
49+
AutoBuildLogger.BeginLogGroup("Build and upload world");
50+
AutoBuildLogger.Log("Building world");
51+
52+
try {
53+
await BuildAsync();
54+
}
55+
catch (Exception e) {
56+
AutoBuildBase.ExitWithException(e);
57+
return;
58+
}
59+
60+
AutoBuildLogger.Log("World build complete");
61+
62+
AutoBuildLogger.Log($"Fetching world: {worldId}");
63+
var world = await FetchWorldAsync(worldId);
64+
AutoBuildLogger.Log(
65+
$"Fetched world: [{world.ID}] {world.Name} by {world.AuthorName}\nDescription: {world.Description}");
66+
67+
AutoBuildLogger.Log(
68+
$"Uploading world: [{world.ID}] {world.Name} by {world.AuthorName}\nDescription: {world.Description}");
69+
try
70+
{
71+
await UploadAsync(world);
72+
} catch (Exception e)
73+
{
74+
AutoBuildBase.ExitWithException(e);
75+
return;
76+
}
77+
78+
AutoBuildLogger.Log("Upload complete");
79+
AutoBuildLogger.EndLogGroup();
80+
81+
EditorApplication.Exit(0);
82+
}
83+
84+
private static async Task BuildAsync() {
85+
if (!VRCSdkControlPanel.TryGetBuilder<IVRCSdkWorldBuilderApi>(out var builder)) {
86+
throw new Exception("Failed to get world builder");
87+
}
88+
89+
var hasIsCompilingNoticed = false;
90+
while (EditorApplication.isCompiling)
91+
{
92+
if (hasIsCompilingNoticed) continue;
93+
94+
AutoBuildLogger.Log("Waiting for scripts to compile");
95+
hasIsCompilingNoticed = true;
96+
}
97+
98+
await builder.Build();
99+
}
100+
101+
private static async Task UploadAsync(VRCWorld world) {
102+
if (!VRCSdkControlPanel.TryGetBuilder<IVRCSdkWorldBuilderApi>(out var builder)) {
103+
throw new Exception("Failed to get world builder");
104+
}
105+
106+
try {
107+
await builder.UploadLastBuild(world);
108+
}
109+
catch (Exception e) {
110+
throw new Exception("Failed to upload world", e);
111+
}
112+
}
113+
114+
private static async Task<VRCWorld> FetchWorldAsync(string worldId) {
115+
try {
116+
return await VRCApi.GetWorld(worldId, true);
117+
}
118+
catch (Exception e)
119+
{
120+
var ex = new Exception("Failed to fetch world", e);
121+
AutoBuildBase.ExitWithException(ex);
122+
123+
throw ex;
124+
}
125+
}
126+
}
127+
}

Packages/com.yuxiaviation.vrchat.autobuild.world/Editor/AutoBuildVRChatWorld.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "VRChatAerospaceUniversity.VRChatAutoBuild.Worlds",
3+
"rootNamespace": "VRChatAerospaceUniversity.VRChatAutoBuild.Worlds",
4+
"references": [
5+
"VRC.SDKBase.Editor",
6+
"VRC.SDK3.Editor",
7+
"VRChatAerospaceUniversity.VRChatAutoBuild"
8+
],
9+
"includePlatforms": [
10+
"Editor"
11+
],
12+
"excludePlatforms": [],
13+
"allowUnsafeCode": false,
14+
"overrideReferences": false,
15+
"precompiledReferences": [],
16+
"autoReferenced": true,
17+
"defineConstraints": [],
18+
"versionDefines": [],
19+
"noEngineReferences": false
20+
}

Packages/com.yuxiaviation.vrchat.autobuild.world/Editor/com.yuxiaviation.vrchat.autobuild.world.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "com.yuxiaviation.vrchat.autobuild.world",
3+
"displayName": "VRChat Content Auto Build - Worlds",
4+
"version": "0.3.1",
5+
"description": "Auto login and build and upload VRChat content.",
6+
"hideInEditor": false,
7+
"license": "MIT",
8+
"vpmDependencies": {
9+
"com.vrchat.worlds": "^3.7.1",
10+
"com.yuxiaviation.vrchat.autobuild": "0.3.1"
11+
},
12+
"author": {
13+
"name": "VRChat Aerospace University",
14+
"email": "lipww1234@foxmail.com",
15+
"url": "https://yuxiaviation.com/"
16+
},
17+
"unity": "2022.3",
18+
"unityRelease": "22f1"
19+
}

Packages/com.yuxiaviation.vrchat.autobuild.world/package.json.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.yuxiaviation.vrchat.autobuild/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using JetBrains.Annotations;
2+
3+
namespace VRChatAerospaceUniversity.VRChatAutoBuild {
4+
[PublicAPI]
5+
public class AutoBuildArguments {
6+
[CanBeNull] public string ContentId;
7+
public string Username;
8+
public string Password;
9+
public string TotpKey;
10+
public string ScenePath;
11+
public string AuthCookie;
12+
public string TwoFactorAuthCookie;
13+
}
14+
}

0 commit comments

Comments
 (0)