From 6dbe85f71257dc8ddc8f0bee7fa03a931a5b7ef5 Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Tue, 27 Feb 2024 21:26:56 +0100 Subject: [PATCH 01/18] Update readme with latest data --- README.md | 75 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 296952ee..ec418d80 100644 --- a/README.md +++ b/README.md @@ -33,38 +33,36 @@ ### Built-in Renderpipeline WebGL2 Version | Size | Link --- | --- | --- -2023.1.20f1 | 3.09 MB | https://deml.io/experiments/unity-webgl/2023.1.20f1-webgl2 -2022.3.15f1 | 3.06 MB | https://deml.io/experiments/unity-webgl/2022.3.15f1-webgl2 -2022.2.18f1 | 3.05 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-webgl2 -2022.1.24f1 | 2.81 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-webgl2 -2021.3.33f1 | 2.76 MB | https://deml.io/experiments/unity-webgl/2021.3.33f1-webgl2 -2021.2.19f1 | 2.74 MB | https://deml.io/experiments/unity-webgl/2021.2.19f1-webgl2 -2021.1.28f1 | 2.94 MB | https://deml.io/experiments/unity-webgl/2021.1.28f1-webgl2 -2020.3.48f1 | 2.95 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-webgl2 +2023.2.10f1 | 3.19 MB | https://deml.io/experiments/unity-webgl/2023.2.10f1-webgl2 +2023.1.20f1 | 3.10 MB | https://deml.io/experiments/unity-webgl/2023.1.20f1-webgl2 +2022.3.20f1 | 3.08 MB | https://deml.io/experiments/unity-webgl/2022.3.20f1-webgl2 +2022.2.18f1 | 3.06 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-webgl2 +2022.1.24f1 | 2.82 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-webgl2 +2021.3.35f1 | 2.77 MB | https://deml.io/experiments/unity-webgl/2021.3.35f1-webgl2 +2020.3.48f1 | 2.96 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-webgl2 2019.4.40f1 | 3.05 MB | https://deml.io/experiments/unity-webgl/2019.4.40f1-webgl2 2018.4.36f1 | 2.84 MB | https://deml.io/experiments/unity-webgl/2018.4.36f1-webgl2 ### Built-in Renderpipeline WebGL1 Version | Size | Link --- | --- | --- -2022.2.18f1 | 3.03 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-webgl1 -2022.1.24f1 | 2.79 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-webgl1 -2021.3.33f1 | 2.74 MB | https://deml.io/experiments/unity-webgl/2021.3.33f1-webgl1 -2021.2.19f1 | 2.72 MB | https://deml.io/experiments/unity-webgl/2021.2.19f1-webgl1 -2021.1.28f1 | 2.92 MB | https://deml.io/experiments/unity-webgl/2021.1.28f1-webgl1 -2020.3.48f1 | 2.93 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-webgl1 +2022.3.20f1 | 3.06 MB | https://deml.io/experiments/unity-webgl/2022.3.20f1-webgl1 +2022.2.18f1 | 3.04 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-webgl1 +2022.1.24f1 | 2.80 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-webgl1 +2021.3.35f1 | 2.76 MB | https://deml.io/experiments/unity-webgl/2021.3.35f1-webgl1 +2020.3.48f1 | 2.94 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-webgl1 2019.4.40f1 | 3.01 MB | https://deml.io/experiments/unity-webgl/2019.4.40f1-webgl1 2018.4.36f1 | 2.82 MB | https://deml.io/experiments/unity-webgl/2018.4.36f1-webgl1 -### Built-in Renderpipeline WebGL1 Minimum size +### Built-in Renderpipeline Minimum size Version | Size | Link --- | --- | --- -2023.1.20f1 | 2.85 MB | https://deml.io/experiments/unity-webgl/2023.1.20f1-minsize-webgl2 -2022.2.18f1 | 2.68 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-minsize-webgl1 -2022.1.24f1 | 2.63 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-minsize-webgl1 -2021.3.33f1 | 2.61 MB | https://deml.io/experiments/unity-webgl/2021.3.33f1-minsize-webgl1 -2021.2.19f1 | 2.56 MB | https://deml.io/experiments/unity-webgl/2021.2.19f1-minsize-webgl1 -2021.1.28f1 | 2.47 MB | https://deml.io/experiments/unity-webgl/2021.1.28f1-minsize-webgl1 +2023.2.10f1 | 3.02 MB | https://deml.io/experiments/unity-webgl/2023.2.10f1-minsize-webgl2 +2023.1.20f1 | 2.86 MB | https://deml.io/experiments/unity-webgl/2023.1.20f1-minsize-webgl2 +2022.3.20f1 | 2.84 MB | https://deml.io/experiments/unity-webgl/2022.3.20f1-minsize-webgl1 +2022.2.18f1 | 2.69 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-minsize-webgl1 +2022.1.24f1 | 2.64 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-minsize-webgl1 +2021.3.35f1 | 2.60 MB | https://deml.io/experiments/unity-webgl/2021.3.35f1-minsize-webgl1 2020.3.48f1 | 2.48 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-minsize-webgl1 2019.4.40f1 | 2.96 MB | https://deml.io/experiments/unity-webgl/2019.4.40f1-minsize-webgl1 2018.4.36f1 | 2.77 MB | https://deml.io/experiments/unity-webgl/2018.4.36f1-minsize-webgl1 @@ -72,30 +70,37 @@ Version | Size | Link ### URP WebGL2 Version | Size | Link --- | --- | --- -2023.1.20f1 | 6.05 MB | https://deml.io/experiments/unity-webgl/2023.1.20f1-urp-webgl2 -2022.3.15f1 | 5.70 MB | https://deml.io/experiments/unity-webgl/2022.3.15f1-urp-webgl2 -2022.2.18f1 | 7.21 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-urp-webgl2 -2022.1.24f1 | 6.45 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-urp-webgl2 -2021.3.33f1 | 6.30 MB | https://deml.io/experiments/unity-webgl/2021.3.33f1-urp-webgl2 -2021.2.19f1 | 6.17 MB | https://deml.io/experiments/unity-webgl/2021.2.19f1-urp-webgl2 -2021.1.28f1 | 5.81 MB | https://deml.io/experiments/unity-webgl/2021.1.28f1-urp-webgl2 -2020.3.48f1 | 5.59 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-urp-webgl2 +2023.2.10f1 | 6.66 MB | https://deml.io/experiments/unity-webgl/2023.2.10f1-urp-webgl2 +2023.1.20f1 | 6.06 MB | https://deml.io/experiments/unity-webgl/2023.1.20f1-urp-webgl2 +2022.3.20f1 | 5.76 MB | https://deml.io/experiments/unity-webgl/2022.3.20f1-urp-webgl2 +2022.2.18f1 | 7.22 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-urp-webgl2 +2022.1.24f1 | 6.47 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-urp-webgl2 +2021.3.35f1 | 6.30 MB | https://deml.io/experiments/unity-webgl/2021.3.35f1-urp-webgl2 +2020.3.48f1 | 5.60 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-urp-webgl2 2019.4.40f1 | 5.56 MB | https://deml.io/experiments/unity-webgl/2019.4.40f1-urp-webgl2 2018.4.36f1 | 2.81 MB | https://deml.io/experiments/unity-webgl/2018.4.36f1-urp-webgl2 ### URP WebGL1 Version | Size | Link --- | --- | --- -2022.3.15f1 | 5.67 MB | https://deml.io/experiments/unity-webgl/2022.3.15f1-urp-webgl1 +2022.3.20f1 | 5.73 MB | https://deml.io/experiments/unity-webgl/2022.3.20f1-urp-webgl1 2022.2.18f1 | 7.08 MB | https://deml.io/experiments/unity-webgl/2022.2.18f1-urp-webgl1 -2022.1.24f1 | 6.30 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-urp-webgl1 -2021.3.33f1 | 6.12 MB | https://deml.io/experiments/unity-webgl/2021.3.33f1-urp-webgl1 -2021.2.19f1 | 5.99 MB | https://deml.io/experiments/unity-webgl/2021.2.19f1-urp-webgl1 -2021.1.28f1 | 5.57 MB | https://deml.io/experiments/unity-webgl/2021.1.28f1-urp-webgl1 -2020.3.48f1 | 5.43 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-urp-webgl1 +2022.1.24f1 | 6.33 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-urp-webgl1 +2021.3.35f1 | 6.12 MB | https://deml.io/experiments/unity-webgl/2021.3.35f1-urp-webgl1 +2020.3.48f1 | 5.44 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-urp-webgl1 2019.4.40f1 | 5.51 MB | https://deml.io/experiments/unity-webgl/2019.4.40f1-urp-webgl1 2018.4.36f1 | 2.80 MB | https://deml.io/experiments/unity-webgl/2018.4.36f1-urp-webgl1 +### URP Minimum Size +Version | Size | Link +--- | --- | --- +2023.2.10f1 | 6.38 MB | https://deml.io/experiments/unity-webgl/2023.2.10f1-urp-minsize-webgl2 +2023.1.20f1 | 5.71 MB | https://deml.io/experiments/unity-webgl/2023.1.20f1-urp-minsize-webgl2 +2022.3.20f1 | 5.38 MB | https://deml.io/experiments/unity-webgl/2022.3.20f1-urp-minsize-webgl1 +2022.1.24f1 | 6.06 MB | https://deml.io/experiments/unity-webgl/2022.1.24f1-urp-minsize-webgl1 +2021.3.35f1 | 5.87 MB | https://deml.io/experiments/unity-webgl/2021.3.35f1-urp-minsize-webgl1 +2020.3.48f1 | 4.86 MB | https://deml.io/experiments/unity-webgl/2020.3.48f1-urp-minsize-webgl1 + ## Platform Compatibility From de7bdf9ac13edc7619f17ebe0713546a44c004f0 Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Sat, 9 Mar 2024 13:52:01 +0100 Subject: [PATCH 02/18] Update release actions to v4 (node 20) --- .github/workflows/activation.yml | 19 ------------------- .github/workflows/release.yml | 12 ++++++------ .github/workflows/upgrade-unity.yml | 6 +++--- 3 files changed, 9 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/activation.yml diff --git a/.github/workflows/activation.yml b/.github/workflows/activation.yml deleted file mode 100644 index a8fe6c2a..00000000 --- a/.github/workflows/activation.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Get Unity license activation file ๐Ÿ”‘ - -on: - workflow_dispatch: {} -jobs: - activation: - name: Request manual activation file ๐Ÿ”‘ - runs-on: ubuntu-latest - steps: - # Request manual activation file - - name: Request manual activation file - id: getManualLicenseFile - uses: game-ci/unity-request-activation-file@v2 - # Upload artifact (Unity_v20XX.X.XXXX.alf) - - name: Expose as artifact - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.getManualLicenseFile.outputs.filePath }} - path: ${{ steps.getManualLicenseFile.outputs.filePath }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef1f5dba..d09b062f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: # Unity 2020 cache is not compatible with older versions - name: Unity Library Cache 2020 or higher if: ${{ !startsWith(needs.variables.outputs.UNITY_VERSION, '201') }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: Library key: Library-202x-WebGL @@ -85,7 +85,7 @@ jobs: - name: Unity Library Cache 2019 or lower if: ${{ startsWith(needs.variables.outputs.UNITY_VERSION, '201') }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: Library key: Library-201x-WebGL @@ -103,7 +103,7 @@ jobs: targetPlatform: WebGL buildName: ${{ needs.variables.outputs.BUILD_NAME }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ needs.variables.outputs.BUILD_NAME }} path: build/WebGL @@ -116,7 +116,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Create Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: body: | ## Changes @@ -140,7 +140,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{ needs.variables.outputs.BUILD_NAME }} path: build @@ -150,7 +150,7 @@ jobs: working-directory: build/${{ needs.variables.outputs.BUILD_NAME }} - name: Deploy โคด - uses: SamKirkland/FTP-Deploy-Action@4.3.3 + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 with: server: ${{ secrets.FTP_SERVER }} username: ${{ secrets.FTP_USER }} diff --git a/.github/workflows/upgrade-unity.yml b/.github/workflows/upgrade-unity.yml index 4df3764e..ba0d2bfc 100644 --- a/.github/workflows/upgrade-unity.yml +++ b/.github/workflows/upgrade-unity.yml @@ -87,7 +87,7 @@ jobs: # Unity 2020 cache is not compatible with older versions - name: Unity Library Cache 2020 or higher if: ${{ !startsWith(inputs.unityVersion, '201') }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: Library key: Library-202x-WebGL @@ -95,7 +95,7 @@ jobs: - name: Unity Library Cache 2019 or lower if: ${{ startsWith(inputs.unityVersion, '201') }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: Library key: Library-201x-WebGL @@ -148,7 +148,7 @@ jobs: - name: Render template if: ${{ !inputs.tagsOnly }} id: template - uses: chuhlomin/render-template@v1.4 + uses: chuhlomin/render-template@v1.9 with: template: .github/templates/upgrade-unity-pr-body.md vars: | From df4465aa3ef4cc4cbd19da18bc66acbc1c3a81b2 Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Mon, 6 May 2024 22:13:32 +0200 Subject: [PATCH 03/18] Change use LTO option for builds --- Assets/Scripts/Editor/BuildScript.cs | 38 +++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Editor/BuildScript.cs b/Assets/Scripts/Editor/BuildScript.cs index 97abfb4e..be5b49dc 100644 --- a/Assets/Scripts/Editor/BuildScript.cs +++ b/Assets/Scripts/Editor/BuildScript.cs @@ -14,6 +14,7 @@ using System.Linq; using JetBrains.Annotations; using UnityEditor; +using UnityEditor.Build; using UnityEditor.Build.Reporting; using UnityEngine; using UnityEngine.Rendering; @@ -31,6 +32,25 @@ public static class BuildScript private static readonly string Eol = Environment.NewLine; private static bool LogVerboseBatchMode = true; private static bool LogVerboseInEditor = false; + private const string CodeOptimizationSpeed = +#if UNITY_2021_3_OR_NEWER + "runtimespeedlto"; +#else + "speed"; +#endif + private const string CodeOptimizationSize = +#if UNITY_2021_3_OR_NEWER + "disksizelto"; +#else + "size"; +#endif + + private const string CodeOptimizationBuildTimes = +#if UNITY_2021_3_OR_NEWER + "buildtimes"; +#else + "size"; +#endif private static readonly string[] Secrets = { "androidKeystorePass", "androidKeyaliasName", "androidKeyaliasPass" }; @@ -84,6 +104,7 @@ public static void Build(string[] args) #if UNITY_2021_2_OR_NEWER // Use ASTC texture compression, since we are also targeting mobile versions - Don't use this for desktop only targets buildPlayerOptions.subtarget = (int)WebGLTextureSubtarget.ASTC; + var namedBuildTarget = NamedBuildTarget.WebGL; #endif if (options.TryGetValue("tag", out string tagVersion) && @@ -93,17 +114,22 @@ public static void Build(string[] args) if (tagParameters.Contains("minsize")) { PlayerSettings.WebGL.template = "PROJECT:Release"; - SetWebGlOptimization("size"); + SetWebGlOptimization(CodeOptimizationSize); + buildPlayerOptions.options |= BuildOptions.CompressWithLz4HC; PlayerSettings.WebGL.exceptionSupport = WebGLExceptionSupport.None; PlayerSettings.SetIl2CppCompilerConfiguration(BuildTargetGroup.WebGL, Il2CppCompilerConfiguration.Master); +#if UNITY_2021_2_OR_NEWER + PlayerSettings.SetIl2CppCodeGeneration(namedBuildTarget, Il2CppCodeGeneration.OptimizeSize); +#endif } else if (tagParameters.Contains("debug")) { PlayerSettings.WebGL.template = "PROJECT:Develop"; - SetWebGlOptimization("size"); PlayerSettings.WebGL.exceptionSupport = WebGLExceptionSupport.FullWithStacktrace; PlayerSettings.SetIl2CppCompilerConfiguration(BuildTargetGroup.WebGL, Il2CppCompilerConfiguration.Debug); + SetWebGlOptimization(CodeOptimizationBuildTimes); #if UNITY_2021_2_OR_NEWER + PlayerSettings.SetIl2CppCodeGeneration(namedBuildTarget, Il2CppCodeGeneration.OptimizeSize); PlayerSettings.WebGL.debugSymbolMode = WebGLDebugSymbolMode.Embedded; #else PlayerSettings.WebGL.debugSymbols = true; @@ -117,8 +143,12 @@ public static void Build(string[] args) else { PlayerSettings.WebGL.template = "PROJECT:Develop"; + PlayerSettings.SetIl2CppCompilerConfiguration(BuildTargetGroup.WebGL, Il2CppCompilerConfiguration.Master); // By default use the speed setting - SetWebGlOptimization("speed"); + SetWebGlOptimization(CodeOptimizationSpeed); +#if UNITY_2021_2_OR_NEWER + PlayerSettings.SetIl2CppCodeGeneration(namedBuildTarget, Il2CppCodeGeneration.OptimizeSpeed); +#endif } List graphicsAPIs = new List(); @@ -155,7 +185,7 @@ public static void Build(string[] args) // Additional options for local builds if (!Application.isBatchMode) { - if (options.TryGetValue("autorunplayer", out string autorunplayer)) + if (options.TryGetValue("autorunplayer", out string _)) { buildPlayerOptions.options |= BuildOptions.AutoRunPlayer; } From 844a1676e1ad1df1596705ef8a5a44ffea26014c Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Mon, 6 May 2024 22:22:25 +0200 Subject: [PATCH 04/18] Also build webgpu version when version is >= 6000 --- .github/workflows/upgrade-unity.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upgrade-unity.yml b/.github/workflows/upgrade-unity.yml index ba0d2bfc..bc87c953 100644 --- a/.github/workflows/upgrade-unity.yml +++ b/.github/workflows/upgrade-unity.yml @@ -137,7 +137,7 @@ jobs: customParameters: ${{ inputs.customParameters }} unityVersion: ${{ inputs.unityVersion }} targetPlatform: WebGL - buildName: ${{ needs.variables.outputs.BUILD_NAME }} + buildName: ${{ steps.upgrade_name.outputs.NAME }} allowDirtyBuild: true manualExit: true @@ -169,7 +169,7 @@ jobs: if: ${{ inputs.createTags || inputs.tagsOnly }} run: | # Extract the first four characters of UNITY_VERSION - UNITY_YEAR=${UNITY_VERSION:0:4} + MAJOR_VERSION=${UNITY_VERSION:0:4} BRANCH_NAME=${GITHUB_REF#refs/heads/} TAG_PREFIX=$UNITY_VERSION @@ -178,7 +178,7 @@ jobs: TAG_PREFIX=$UNITY_VERSION-urp fi - if [[ "$UNITY_YEAR" < "2023" ]] + if [[ "$MAJOR_VERSION" < "2023" ]] then git tag -a -f $TAG_PREFIX-minsize-webgl1 -m "[Automated workflow] Created by upgrade-unity" git tag -a -f $TAG_PREFIX-webgl1 -m "[Automated workflow] Created by upgrade-unity" @@ -191,6 +191,11 @@ jobs: git tag -a -f $TAG_PREFIX-webgl2 -m "[Automated workflow] Created by upgrade-unity" git tag -a -f $TAG_PREFIX-webgl2-debug -m "[Automated workflow] Created by upgrade-unity" + if [[ "$MAJOR_VERSION" >= "6000" ]] + then + git tag -a -f $TAG_PREFIX-webgpu -m "[Automated workflow] Created by upgrade-unity" + fi + git push origin -f --tags env: UNITY_VERSION: ${{ inputs.unityVersion }} From 1347d6f3652423f01d7e6bd7f2dd8b5941cd19ae Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Mon, 6 May 2024 23:11:03 +0200 Subject: [PATCH 05/18] Move tagging script out of workflow into its own script --- .github/scripts/add-tags.sh | 39 +++++++++++++++++++++++++++++ .github/workflows/upgrade-unity.yml | 29 +++------------------ 2 files changed, 43 insertions(+), 25 deletions(-) create mode 100644 .github/scripts/add-tags.sh diff --git a/.github/scripts/add-tags.sh b/.github/scripts/add-tags.sh new file mode 100644 index 00000000..6af2b504 --- /dev/null +++ b/.github/scripts/add-tags.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# This script creates tags for the given unity version to trigger the release workflow +# example usage +# sh add-tags.sh "6000.0.0f1" -> Creates tags for non-urp version +# sh add-tags.sh "6000.0.0f1" "true" -> Creates tags for urp version + +# Input parameters +UNITY_VERSION=$1 +IS_URP=${2:-"false"} + +# Extract the first four characters of UNITY_VERSION +MAJOR_VERSION=${UNITY_VERSION:0:4} +BRANCH_NAME=${GITHUB_REF#refs/heads/} + +TAG_PREFIX=$UNITY_VERSION +if [[ "$IS_URP" == "true" ]] +then +TAG_PREFIX=$UNITY_VERSION-urp +fi + +if [[ "$MAJOR_VERSION" -lt "2023" ]] +then +git tag -a -f $TAG_PREFIX-minsize-webgl1 -m "[Automated workflow] Created by upgrade-unity" +git tag -a -f $TAG_PREFIX-webgl1 -m "[Automated workflow] Created by upgrade-unity" +else +git tag -a -f $TAG_PREFIX-minsize-webgl2 -m "[Automated workflow] Created by upgrade-unity" +fi +# Push tags in between - pushing more than 3 tags won't trigger tag workflows +git push origin -f --tags + +git tag -a -f $TAG_PREFIX-webgl2 -m "[Automated workflow] Created by upgrade-unity" +git tag -a -f $TAG_PREFIX-webgl2-debug -m "[Automated workflow] Created by upgrade-unity" + +if [[ "$MAJOR_VERSION" -ge "6000" ]] +then +git tag -a -f $TAG_PREFIX-webgpu -m "[Automated workflow] Created by upgrade-unity" +fi + +git push origin -f --tags \ No newline at end of file diff --git a/.github/workflows/upgrade-unity.yml b/.github/workflows/upgrade-unity.yml index bc87c953..7cda87e5 100644 --- a/.github/workflows/upgrade-unity.yml +++ b/.github/workflows/upgrade-unity.yml @@ -168,35 +168,14 @@ jobs: - name: Add tags if: ${{ inputs.createTags || inputs.tagsOnly }} run: | - # Extract the first four characters of UNITY_VERSION - MAJOR_VERSION=${UNITY_VERSION:0:4} BRANCH_NAME=${GITHUB_REF#refs/heads/} - TAG_PREFIX=$UNITY_VERSION - if [[ "$BRANCH_NAME" == *"urp"* ]] - then - TAG_PREFIX=$UNITY_VERSION-urp - fi - - if [[ "$MAJOR_VERSION" < "2023" ]] - then - git tag -a -f $TAG_PREFIX-minsize-webgl1 -m "[Automated workflow] Created by upgrade-unity" - git tag -a -f $TAG_PREFIX-webgl1 -m "[Automated workflow] Created by upgrade-unity" - else - git tag -a -f $TAG_PREFIX-minsize-webgl2 -m "[Automated workflow] Created by upgrade-unity" - fi - # Push tags in between - pushing more than 3 tags won't trigger tag workflows - git push origin -f --tags - - git tag -a -f $TAG_PREFIX-webgl2 -m "[Automated workflow] Created by upgrade-unity" - git tag -a -f $TAG_PREFIX-webgl2-debug -m "[Automated workflow] Created by upgrade-unity" - - if [[ "$MAJOR_VERSION" >= "6000" ]] - then - git tag -a -f $TAG_PREFIX-webgpu -m "[Automated workflow] Created by upgrade-unity" + IS_URP=false + if [[ "$BRANCH_NAME" == *"urp"* ]]; then + IS_URP=true fi - git push origin -f --tags + sh .github/scripts/add-tags.sh $UNITY_VERSION $IS_URP env: UNITY_VERSION: ${{ inputs.unityVersion }} From 11f27b5fe67dd7cba307aeacd2861b18c0382d22 Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Mon, 6 May 2024 23:39:17 +0200 Subject: [PATCH 06/18] Add output to the shell script for easier debugging --- .github/scripts/add-tags.sh | 1 + .github/workflows/upgrade-unity.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/add-tags.sh b/.github/scripts/add-tags.sh index 6af2b504..de36164f 100644 --- a/.github/scripts/add-tags.sh +++ b/.github/scripts/add-tags.sh @@ -7,6 +7,7 @@ # Input parameters UNITY_VERSION=$1 IS_URP=${2:-"false"} +echo "Running add_tags.sh with UNITY_VERSION: $UNITY_VERSION, IS_URP: $IS_URP" # Extract the first four characters of UNITY_VERSION MAJOR_VERSION=${UNITY_VERSION:0:4} diff --git a/.github/workflows/upgrade-unity.yml b/.github/workflows/upgrade-unity.yml index 7cda87e5..79bbf034 100644 --- a/.github/workflows/upgrade-unity.yml +++ b/.github/workflows/upgrade-unity.yml @@ -175,7 +175,8 @@ jobs: IS_URP=true fi - sh .github/scripts/add-tags.sh $UNITY_VERSION $IS_URP + # Run add tags script + ./.github/scripts/add-tags.sh "$UNITY_VERSION" "$IS_URP" env: UNITY_VERSION: ${{ inputs.unityVersion }} From 8b3a6256f6c91edb2be7e8224f1c21144d825d0a Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Mon, 6 May 2024 23:46:44 +0200 Subject: [PATCH 07/18] Change make add tags executable --- .github/scripts/add-tags.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/scripts/add-tags.sh diff --git a/.github/scripts/add-tags.sh b/.github/scripts/add-tags.sh old mode 100644 new mode 100755 From b1f7273a400fd201a324d2d35b1cf7f835af711f Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Tue, 7 May 2024 00:02:28 +0200 Subject: [PATCH 08/18] Add note for supporting Unity 6 --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ec418d80..31b381db 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ![Preview](./preview.png) -[![](https://img.shields.io/github/release-date/JohannesDeml/UnityWebGL-LoadingTest.svg)](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/releases) [![Tested up to Unity 2023.2](https://img.shields.io/badge/tested%20up%20to%20unity-2023.2-green.svg?logo=unity&cacheSeconds=2592000)](https://unity3d.com/get-unity/download/archive) +[![](https://img.shields.io/github/release-date/JohannesDeml/UnityWebGL-LoadingTest.svg)](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/releases) [![Tested up to Unity 6](https://img.shields.io/badge/tested%20up%20to%20unity-6000.0-green.svg?logo=unity&cacheSeconds=2592000)](https://unity3d.com/get-unity/download/archive) -*Testing Unity's WebGL size and loading time for different versions (2018.4 - 2023.2) and platforms* +*Testing Unity's WebGL size and loading time for different versions (2018.4 - 6000.0) and platforms* * [Unity Forum Thread](https://forum.unity.com/threads/webgl-builds-for-mobile.545877/) * [Overview page of all builds](https://deml.io/experiments/unity-webgl/) @@ -26,6 +26,7 @@ * Github Actions to automatically build the project and deploy it on the server via [Game CI](https://game.ci/) * Works with [Unity WebGL Publisher](https://play.unity.com/discover/all-showcases) (Use [2020.3-lts](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/tree/2020-lts) or [2020.3-lts-urp](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/tree/2020-lts-urp) branch) * Tracking multiple Unity versions starting from 2018.4 +* Build targets for webgl1, webgl2 and webgpu ## Live Demos From 00ea15cc8f0f7723f9bd1d620e67785597bf2a3d Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Wed, 15 May 2024 22:15:37 +0200 Subject: [PATCH 09/18] Add preload tags for data, wasm and framework.js files This way they are started to being loaded right away, and already have made some progress when the loader requests them --- Assets/WebGLTemplates/Develop/index.html | 6 +++++- Assets/WebGLTemplates/Release/index.html | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/WebGLTemplates/Develop/index.html b/Assets/WebGLTemplates/Develop/index.html index e28a13b1..d0583e2f 100644 --- a/Assets/WebGLTemplates/Develop/index.html +++ b/Assets/WebGLTemplates/Develop/index.html @@ -4,6 +4,11 @@ + + + + + {{{ PRODUCT_NAME }}} - diff --git a/Assets/WebGLTemplates/Release/index.html b/Assets/WebGLTemplates/Release/index.html index 38ef3e38..cdd784ae 100644 --- a/Assets/WebGLTemplates/Release/index.html +++ b/Assets/WebGLTemplates/Release/index.html @@ -4,6 +4,10 @@ + + + + {{{ PRODUCT_NAME }}}