From df3ec32bcec1d9e9583047fbed0a5bd8c5f77b2f Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 28 Jan 2025 17:12:31 +0900 Subject: [PATCH 1/7] quit --- .github/workflows/build-webgl.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-webgl.yml b/.github/workflows/build-webgl.yml index 4adaae47a..983a33557 100644 --- a/.github/workflows/build-webgl.yml +++ b/.github/workflows/build-webgl.yml @@ -2,6 +2,9 @@ name: WebGL to gh-page on: workflow_dispatch: + push: + branches: + - workflow-webgl-wip env: UNITY_PROJECT_PATH: . @@ -58,7 +61,7 @@ jobs: run: | # build to Build/SimpleViewer "${{ steps.detect-unity-version.outputs.unity-editor-executable }}" \ - -batchmode \ + -batchmode -quit \ -silent-crashes \ -projectPath "${{ env.UNITY_PROJECT_PATH }}" \ -executeMethod "VRM.BuildClass.BuildWebGL_SimpleViewer" \ From de8444bbea54c27de462c0dd113f152130165408 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 28 Jan 2025 19:15:00 +0900 Subject: [PATCH 2/7] build VRM10Viewer and SimpleViewer --- .github/workflows/build-webgl.yml | 40 ++++++++++++++++++++++---- Assets/VRM/Editor/BuildClass.cs | 28 ++++-------------- Assets/VRM/Editor/VrmTopMenu.cs | 10 +++---- Assets/VRM10/Editor/BuildClass.cs | 27 +++++++++++++++++ Assets/VRM10/Editor/BuildClass.cs.meta | 11 +++++++ Assets/VRM10/Editor/Vrm10TopMenu.cs | 3 ++ 6 files changed, 87 insertions(+), 32 deletions(-) create mode 100644 Assets/VRM10/Editor/BuildClass.cs create mode 100644 Assets/VRM10/Editor/BuildClass.cs.meta diff --git a/.github/workflows/build-webgl.yml b/.github/workflows/build-webgl.yml index 983a33557..d4b3d4a37 100644 --- a/.github/workflows/build-webgl.yml +++ b/.github/workflows/build-webgl.yml @@ -56,17 +56,47 @@ jobs: echo "${UNITY_EDITOR_EXECUTABLE} is installed." echo "unity-editor-executable=${UNITY_EDITOR_EXECUTABLE}" >> "${GITHUB_OUTPUT}" - - name: Buidl WebGL - id: build-webgl + # URP + - name: Build VRM10Viewer + id: build-webgl-VRM10Viewer run: | + # build to Build/VRM10Viewer + "${{ steps.detect-unity-version.outputs.unity-editor-executable }}" \ + -batchmode -quit \ + -silent-crashes \ + -projectPath "${{ env.UNITY_PROJECT_PATH }}" \ + -executeMethod "UniVRM10.DevOnly.BuildClass.BuildWebGL_VRM10Viewer" \ + -logFile webgl-VRM10Viewer.log + echo "Success to WebGL VRM10Viewer." + + # はじめに built-in RenderPipeline にして一度終わる。然るのちに + - name: Build SimpleViewer + id: build-webgl-SimpleViewer + run: | + "${{ steps.detect-unity-version.outputs.unity-editor-executable }}" \ + -batchmode -quit \ + -silent-crashes \ + -projectPath "${{ env.UNITY_PROJECT_PATH }}" \ + -executeMethod "VRM.DevOnly.BuildClass.SwitchBuiltinPipeline" + echo "Success to Switch built-in RenderPipeline." + # build to Build/SimpleViewer "${{ steps.detect-unity-version.outputs.unity-editor-executable }}" \ -batchmode -quit \ -silent-crashes \ -projectPath "${{ env.UNITY_PROJECT_PATH }}" \ - -executeMethod "VRM.BuildClass.BuildWebGL_SimpleViewer" \ - -logFile create-webgl.log - echo "Success to create BuildWebGL." + -executeMethod "VRM.DevOnly.BuildClass.BuildWebGL_SimpleViewer" \ + -logFile webgl-SimpleViewer.log + echo "Success to WebGL SimpleViewer." + + # make index + cat <<__HTML__ > Build/index.html +

${{ vars.GITHUB_SHA }}

+ +__HTML__ - name: Upload artifact uses: actions/upload-pages-artifact@v2 diff --git a/Assets/VRM/Editor/BuildClass.cs b/Assets/VRM/Editor/BuildClass.cs index 410de15a4..cff6d56ff 100644 --- a/Assets/VRM/Editor/BuildClass.cs +++ b/Assets/VRM/Editor/BuildClass.cs @@ -1,7 +1,6 @@ using UnityEditor; -using UnityEngine.Rendering; -namespace VRM +namespace VRM.DevOnly { public static class BuildClass { @@ -27,6 +26,11 @@ namespace VRM } } + public static void SwitchBuiltinPipeline() + { + UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset = null; + } + public static void BuildWebGL_SimpleViewer() { var scenes = new string[]{ @@ -46,25 +50,5 @@ namespace VRM throw new System.Exception(report.summary.ToString()); } } - - public static void BuildWebGL_VRM10Viewer() - { - var scenes = new string[]{ - "./Assets/VRM10_Samples/VRM10Viewer/VRM10Viewer.unity", - }; - - var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions - { - scenes = scenes, - locationPathName = "Build/VRM10Viewer", - target = BuildTarget.WebGL, - } - ); - - if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded) - { - throw new System.Exception(report.summary.ToString()); - } - } } } diff --git a/Assets/VRM/Editor/VrmTopMenu.cs b/Assets/VRM/Editor/VrmTopMenu.cs index 7c8caa901..d9aab4784 100644 --- a/Assets/VRM/Editor/VrmTopMenu.cs +++ b/Assets/VRM/Editor/VrmTopMenu.cs @@ -53,13 +53,13 @@ namespace VRM private static void ShowVersionDialog() => VRMVersionMenu.ShowVersionDialog(); [MenuItem(DevelopmentMenuPrefix + "/Build dummy for CI", false, 93)] - private static void BuildDummyForCi() => BuildClass.Build(); + private static void BuildDummyForCi() => DevOnly.BuildClass.Build(); - [MenuItem(DevelopmentMenuPrefix + "/Build 0x WebGL for CI", false, 94)] - private static void BuildWebGLForCi0x() => BuildClass.BuildWebGL_SimpleViewer(); + [MenuItem(DevelopmentMenuPrefix + "/Switch to built-in RenderPipeline", false, 94)] + private static void SwitchToBuiltinPipeline() => DevOnly.BuildClass.SwitchBuiltinPipeline(); - [MenuItem(DevelopmentMenuPrefix + "/Build 10 WebGL for CI", false, 95)] - private static void BuildWebGLForCi10() => BuildClass.BuildWebGL_VRM10Viewer(); + [MenuItem(DevelopmentMenuPrefix + "/Build WebGL SimpleViewer for CI", false, 95)] + private static void BuildWebGLForCi0x() => DevOnly.BuildClass.BuildWebGL_SimpleViewer(); [MenuItem(DevelopmentMenuPrefix + "/Create UnityPackage", false, 99)] private static void CreateUnityPackage() => VRMExportUnityPackage.CreateUnityPackageWithoutBuild(); diff --git a/Assets/VRM10/Editor/BuildClass.cs b/Assets/VRM10/Editor/BuildClass.cs new file mode 100644 index 000000000..230151a98 --- /dev/null +++ b/Assets/VRM10/Editor/BuildClass.cs @@ -0,0 +1,27 @@ +using UnityEditor; + +namespace UniVRM10.DevOnly +{ + public static class BuildClass + { + public static void BuildWebGL_VRM10Viewer() + { + var scenes = new string[]{ + "./Assets/VRM10_Samples/VRM10Viewer/VRM10Viewer.unity", + }; + + var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions + { + scenes = scenes, + locationPathName = "Build/VRM10Viewer", + target = BuildTarget.WebGL, + } + ); + + if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded) + { + throw new System.Exception(report.summary.ToString()); + } + } + } +} \ No newline at end of file diff --git a/Assets/VRM10/Editor/BuildClass.cs.meta b/Assets/VRM10/Editor/BuildClass.cs.meta new file mode 100644 index 000000000..df70f0176 --- /dev/null +++ b/Assets/VRM10/Editor/BuildClass.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3783cb4bfaca889418092d0fdde301ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10/Editor/Vrm10TopMenu.cs b/Assets/VRM10/Editor/Vrm10TopMenu.cs index e0cc2d8eb..476e4d093 100644 --- a/Assets/VRM10/Editor/Vrm10TopMenu.cs +++ b/Assets/VRM10/Editor/Vrm10TopMenu.cs @@ -26,6 +26,9 @@ namespace UniVRM10 [MenuItem(DevelopmentMenuPrefix + "/Generate from JsonSchema(debug)", false, 101)] private static void Parse() => Vrm10SerializerGenerator.Run(true); + + [MenuItem(DevelopmentMenuPrefix + "/Build WebGL VRM10Viewer for CI", false, 95)] + private static void BuildWebGLForCi10() => DevOnly.BuildClass.BuildWebGL_VRM10Viewer(); #endif } } From 77b8e5082c3d23bfc80d445805e0c0786b657a14 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 28 Jan 2025 19:16:17 +0900 Subject: [PATCH 3/7] fix bash env --- .github/workflows/build-webgl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-webgl.yml b/.github/workflows/build-webgl.yml index d4b3d4a37..a63924706 100644 --- a/.github/workflows/build-webgl.yml +++ b/.github/workflows/build-webgl.yml @@ -91,7 +91,7 @@ jobs: # make index cat <<__HTML__ > Build/index.html -

${{ vars.GITHUB_SHA }}

+

$GITHUB_SHA

  • URPVRM10Viewer
  • Built-inSimpleViewer
  • From 4874b79a08fb1122f77b80f0d1f2d403c8f0b2a2 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 28 Jan 2025 19:19:21 +0900 Subject: [PATCH 4/7] fix indent --- .github/workflows/build-webgl.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-webgl.yml b/.github/workflows/build-webgl.yml index a63924706..4c990e14f 100644 --- a/.github/workflows/build-webgl.yml +++ b/.github/workflows/build-webgl.yml @@ -90,13 +90,13 @@ jobs: echo "Success to WebGL SimpleViewer." # make index - cat <<__HTML__ > Build/index.html -

    $GITHUB_SHA

    - -__HTML__ + cat << '__HTML__' > Build/index.html +

    $GITHUB_SHA

    + + __HTML__ - name: Upload artifact uses: actions/upload-pages-artifact@v2 From e51c21fb23ba5b08e5d96f9217882b9a435e5f7a Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 28 Jan 2025 19:39:14 +0900 Subject: [PATCH 5/7] quote --- .github/workflows/build-webgl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-webgl.yml b/.github/workflows/build-webgl.yml index 4c990e14f..8421b6a8a 100644 --- a/.github/workflows/build-webgl.yml +++ b/.github/workflows/build-webgl.yml @@ -90,7 +90,7 @@ jobs: echo "Success to WebGL SimpleViewer." # make index - cat << '__HTML__' > Build/index.html + cat << __HTML__ > Build/index.html

    $GITHUB_SHA

    • URPVRM10Viewer
    • From 217abf20e9d8d247b6417f2963984e88b5fd874f Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 28 Jan 2025 20:05:21 +0900 Subject: [PATCH 6/7] 201 --- Assets/VRM10/Editor/Vrm10TopMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/VRM10/Editor/Vrm10TopMenu.cs b/Assets/VRM10/Editor/Vrm10TopMenu.cs index 476e4d093..ace2ff2cf 100644 --- a/Assets/VRM10/Editor/Vrm10TopMenu.cs +++ b/Assets/VRM10/Editor/Vrm10TopMenu.cs @@ -27,7 +27,7 @@ namespace UniVRM10 [MenuItem(DevelopmentMenuPrefix + "/Generate from JsonSchema(debug)", false, 101)] private static void Parse() => Vrm10SerializerGenerator.Run(true); - [MenuItem(DevelopmentMenuPrefix + "/Build WebGL VRM10Viewer for CI", false, 95)] + [MenuItem(DevelopmentMenuPrefix + "/Build WebGL VRM10Viewer for CI", false, 201)] private static void BuildWebGLForCi10() => DevOnly.BuildClass.BuildWebGL_VRM10Viewer(); #endif } From 5443d662d556531687ae5c421b8914db06a3cc29 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 28 Jan 2025 20:09:57 +0900 Subject: [PATCH 7/7] =?UTF-8?q?work-flow=20=E3=81=AE=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E7=99=BA=E5=8B=95=E3=82=92=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-webgl.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-webgl.yml b/.github/workflows/build-webgl.yml index 8421b6a8a..cfaaac27e 100644 --- a/.github/workflows/build-webgl.yml +++ b/.github/workflows/build-webgl.yml @@ -2,9 +2,9 @@ name: WebGL to gh-page on: workflow_dispatch: - push: - branches: - - workflow-webgl-wip + # push: + # branches: + # - workflow-webgl-wip env: UNITY_PROJECT_PATH: .