Skip to content

Commit 4255a2c

Browse files
committed
Merge branch 'master' into 2021.3-urp
2 parents f1d3790 + 6638022 commit 4255a2c

File tree

6 files changed

+41
-13
lines changed

6 files changed

+41
-13
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
restore-keys: Library-201x-
9393

9494
- name: Build project
95-
uses: game-ci/unity-builder@v2
95+
uses: game-ci/unity-builder@v3
9696
env:
9797
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
9898
with:

.github/workflows/upgrade-unity.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77
inputs:
88
unityVersion:
9-
description: 'Unity Version'
9+
description: 'Unity version'
1010
required: true
1111
type: string
1212
createTags:
@@ -44,15 +44,18 @@ jobs:
4444
steps:
4545
- name: Log input parameter
4646
run: |
47-
echo "Upgrading to Unity Version: $UNITY_VERSION"
47+
echo "Unity version: $UNITY_VERSION"
4848
echo "Create tags: $CREATE_TAGS"
4949
echo "URP branch: $URP_BRANCH"
50+
echo "Only create tags: $TAGS_ONLY"
51+
echo "Merge master into branch: $MERGE_MASTER"
5052
echo "Custom cli arguments: $CUSTOM_PARAMETERS"
5153
env:
5254
UNITY_VERSION: ${{ inputs.unityVersion }}
5355
CREATE_TAGS: ${{ inputs.createTags }}
5456
URP_BRANCH: ${{ inputs.urp }}
5557
TAGS_ONLY: ${{ inputs.tagsOnly }}
58+
MERGE_MASTER: ${{ inputs.mergeMaster }}
5659
CUSTOM_PARAMETERS: ${{ inputs.customParameters }}
5760

5861
- uses: actions/checkout@v3
@@ -74,7 +77,7 @@ jobs:
7477
- name: Merge master into current branch
7578
if: ${{ inputs.mergeMaster }}
7679
run: |
77-
git fetch origin master --depth=1
80+
git fetch origin master
7881
git merge FETCH_HEAD
7982
git push
8083
@@ -121,7 +124,8 @@ jobs:
121124
122125
- name: Build project
123126
if: ${{ !inputs.tagsOnly }}
124-
uses: JohannesDeml/unity-builder@no-quit-parameter
127+
# TODO change this back to v3 once manual exit is supported there
128+
uses: game-ci/unity-builder@main
125129
env:
126130
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
127131
with:
@@ -131,6 +135,7 @@ jobs:
131135
targetPlatform: WebGL
132136
buildName: ${{ needs.variables.outputs.BUILD_NAME }}
133137
allowDirtyBuild: true
138+
manualExit: true
134139

135140
- name: Delete build folder with elevated rights
136141
if: ${{ !inputs.tagsOnly }}

Assets/Scripts/Editor/BuildScript.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ namespace UnityBuilderAction
2323
/// <summary>
2424
/// Used for building the project through continuous integration (CI) or semi-automated through menu items
2525
/// Supports logging in the editor and highly configurable WebGL
26-
/// Modified version of <see href="https://github.com/game-ci/documentation/blob/main/example/BuildScript.cs">
27-
/// Tailored to the needs for <see href="https://github.com/JohannesDeml/UnityWebGL-LoadingTest">
26+
/// Modified version of <see href="https://github.com/game-ci/documentation/blob/main/example/BuildScript.cs" />
27+
/// Tailored to the needs for <see href="https://github.com/JohannesDeml/UnityWebGL-LoadingTest" />
2828
/// </summary>
2929
public static class BuildScript
3030
{
@@ -108,6 +108,10 @@ public static void Build(string[] args)
108108
#else
109109
PlayerSettings.WebGL.debugSymbols = true;
110110
#endif
111+
112+
#if UNITY_2022_2_OR_NEWER
113+
PlayerSettings.WebGL.showDiagnostics = true;
114+
#endif
111115
buildPlayerOptions.options |= BuildOptions.Development;
112116
}
113117
else

Assets/Scripts/Editor/UnityPackageScripts.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ private static void UpdatePackages()
108108

109109
string latestVersion = IncludePrereleases ?
110110
package.versions.latestCompatible :
111-
#if UNITY_2019_3_OR_NEWER
111+
#if UNITY_2022_3_OR_NEWER
112+
package.versions.recommended;
113+
#elif UNITY_2019_3_OR_NEWER
112114
package.versions.verified;
113115
#else
114116
package.versions.recommended;
@@ -226,8 +228,24 @@ private static void EndUpdate(int returnValue)
226228
#if UNITY_2020_1_OR_NEWER
227229
Progress.Finish(ProgressId, returnValue == 0 ? Progress.Status.Succeeded : Progress.Status.Failed);
228230
#endif
231+
Debug.Log($"Updating unity packages finished with exit code {returnValue}");
232+
229233
if (Application.isBatchMode)
230234
{
235+
// Hack for unity-builder v3, since it is expecting a build result output
236+
Console.WriteLine(
237+
$"{Environment.NewLine}" +
238+
$"###########################{Environment.NewLine}" +
239+
$"# Build results #{Environment.NewLine}" +
240+
$"###########################{Environment.NewLine}" +
241+
$"{Environment.NewLine}" +
242+
$"Duration: 0{Environment.NewLine}" +
243+
$"Warnings: 0{Environment.NewLine}" +
244+
$"Errors: 0{Environment.NewLine}" +
245+
$"Size: 0 bytes{Environment.NewLine}" +
246+
$"{Environment.NewLine}"
247+
);
248+
231249
EditorApplication.Exit(returnValue);
232250
}
233251
else
@@ -236,8 +254,6 @@ private static void EndUpdate(int returnValue)
236254
{
237255
throw new Exception($"BuildScript ended with non-zero exitCode: {returnValue}");
238256
}
239-
240-
Debug.Log($"Successfully updated packages");
241257
}
242258
}
243259
}

Assets/WebGLTemplates/Develop/debug-console.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// Processes all unity log messages and converts unity rich text to css styled console messages & adds a debug html debug console
2+
/// from https://github.com/JohannesDeml/UnityWebGL-LoadingTest
3+
14
let consoleDiv;
25
let debugToggle;
36
let logCounterDivs = {};

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
![Preview](./preview.png)
44

5-
[![](https://img.shields.io/github/release-date/JohannesDeml/UnityWebGL-LoadingTest.svg)](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/releases) [![Tested up to Unity 2022.2](https://img.shields.io/badge/tested%20up%20to%20unity-2022.2-green.svg?logo=unity&cacheSeconds=2592000)](https://unity3d.com/get-unity/download/archive)
5+
[![](https://img.shields.io/github/release-date/JohannesDeml/UnityWebGL-LoadingTest.svg)](https://github.com/JohannesDeml/UnityWebGL-LoadingTest/releases) [![Tested up to Unity 2022.3](https://img.shields.io/badge/tested%20up%20to%20unity-2022.3-green.svg?logo=unity&cacheSeconds=2592000)](https://unity3d.com/get-unity/download/archive)
66

7-
*Testing Unity's WebGL size and loading time for different versions (2018.4 - 2022.2) and platforms*
7+
*Testing Unity's WebGL size and loading time for different versions (2018.4 - 2022.3) and platforms*
88

99
* [Unity Forum Thread](https://forum.unity.com/threads/webgl-builds-for-mobile.545877/)
1010
* [Overview page of all builds](https://deml.io/experiments/unity-webgl/)
@@ -204,4 +204,4 @@ You can find a list of all live builds with their sizes over here: https://deml.
204204

205205
## License
206206

207-
* MIT (c) Johannes Deml - see [LICENSE](./LICENSE.md)
207+
* MIT (c) Johannes Deml - see [LICENSE](./LICENSE.md)

0 commit comments

Comments
 (0)