Skip to content

Commit 7791766

Browse files
unity-setup@v1.0.16 (#19)
- fix editor install corrupted async hook edge case
1 parent 4773acc commit 7791766

File tree

6 files changed

+24
-8
lines changed

6 files changed

+24
-8
lines changed

.github/workflows/update-release-tags.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Update Release Tags
22
on:
33
push:
4-
tags: v?[0-9].[0-9].[0-9]
4+
tags: '*'
5+
workflow_dispatch:
56
jobs:
67
update-release-tags:
78
runs-on: ubuntu-latest

dist/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34805,7 +34805,15 @@ async function Unity(version, changeset, architecture, modules) {
3480534805
}
3480634806
let editorPath = await checkInstalledEditors(version, architecture, false);
3480734807
if (!editorPath) {
34808-
await installUnity(version, changeset, architecture, modules);
34808+
try {
34809+
await installUnity(version, changeset, architecture, modules);
34810+
}
34811+
catch (error) {
34812+
if (error.message.includes('Editor already installed in this location')) {
34813+
uninstallUnity(editorPath);
34814+
await installUnity(version, changeset, architecture, modules);
34815+
}
34816+
}
3480934817
editorPath = await checkInstalledEditors(version, architecture);
3481034818
}
3481134819
await fs.promises.access(editorPath, fs.constants.X_OK);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-setup",
3-
"version": "1.0.15",
3+
"version": "1.0.16",
44
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
55
"author": "Buildalon",
66
"license": "MIT",

src/unity-hub.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async function execUnityHub(args: string[]): Promise<string> {
207207
const match = output.match(/Assertion (?<assert>.+) failed/g);
208208
if (match ||
209209
output.includes('async hook stack has become corrupted')) {
210-
core.warning(`Install failed, retrying...`)
210+
core.warning(`Install failed, retrying...`);
211211
return await execUnityHub(args);
212212
}
213213
if (output.includes('Error:')) {
@@ -234,7 +234,14 @@ async function Unity(version: string, changeset: string, architecture: string, m
234234
}
235235
let editorPath = await checkInstalledEditors(version, architecture, false);
236236
if (!editorPath) {
237-
await installUnity(version, changeset, architecture, modules);
237+
try {
238+
await installUnity(version, changeset, architecture, modules);
239+
} catch (error) {
240+
if (error.message.includes('Editor already installed in this location')) {
241+
uninstallUnity(editorPath);
242+
await installUnity(version, changeset, architecture, modules);
243+
}
244+
}
238245
editorPath = await checkInstalledEditors(version, architecture);
239246
}
240247
await fs.promises.access(editorPath, fs.constants.X_OK);

0 commit comments

Comments
 (0)