Skip to content

Commit a8a438f

Browse files
- update [email protected] - updated build-options test matrix
1 parent 41b9522 commit a8a438f

File tree

6 files changed

+49
-40
lines changed

6 files changed

+49
-40
lines changed

.github/workflows/build-options.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
"None",
99
"4.7.2",
1010
"5.6.7f1 (e80cc3114ac1)",
11-
"2020.3",
11+
"2019.4",
12+
"2020",
1213
"2021.3.x",
1314
"2022.x",
1415
"6000.0.x",
15-
"6000.1.x",
16-
"6000"
16+
"6000.1.*",
17+
"6000.2"
1718
],
1819
"include": [
1920
{
2021
"os": "ubuntu-latest",
21-
"build-targets": "StandaloneLinux64, Android, iOS",
22+
"build-targets": "StandaloneLinux64, Android, iOS, WebGL",
2223
"modules": "linux-server"
2324
},
2425
{
@@ -69,7 +70,7 @@
6970
{
7071
"os": "ubuntu-latest",
7172
"unity-version": "None",
72-
"build-targets": "StandaloneLinux64, Android, iOS",
73+
"build-targets": "StandaloneLinux64, Android, iOS, WebGL",
7374
"modules": "linux-server"
7475
},
7576
{

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ jobs:
6060
if [[ "$MATRIX_UNITY_VERSION_PREFIX" =~ ^([0-9]+\.[0-9]+\.[0-9]+[abcfpx]?[0-9]*) ]]; then
6161
MATRIX_UNITY_VERSION_PREFIX="${BASH_REMATCH[1]}"
6262
fi
63-
# Support matrix.unity-version patterns ending with .x after major.minor (e.g., 2021.3.x)
64-
if [[ "${{ matrix.unity-version }}" =~ ^([0-9]+\.[0-9]+)\.x$ ]]; then
63+
# Support matrix.unity-version patterns ending with .x or .* after major.minor (e.g., 2021.3.x or 2021.3.*)
64+
if [[ "${{ matrix.unity-version }}" =~ ^([0-9]+\.[0-9]+)\.[x\*]$ ]]; then
6565
UNITY_MAJOR_MINOR="${BASH_REMATCH[1]}"
6666
if [[ "$UNITY_EDITOR_VERSION" == "$UNITY_MAJOR_MINOR"* ]]; then
6767
echo "Unity version matches matrix.unity-version: $UNITY_EDITOR_VERSION satisfies ${{ matrix.unity-version }}"
6868
else
6969
echo "Unity version mismatch: $UNITY_EDITOR_VERSION does not satisfy ${{ matrix.unity-version }}"
7070
exit 1
7171
fi
72-
# Support matrix.unity-version patterns ending with .x after major (e.g., 2022.x)
73-
elif [[ "${{ matrix.unity-version }}" =~ ^([0-9]+)\.x$ ]]; then
72+
# Support matrix.unity-version patterns ending with .x or .* after major (e.g., 2022.x or 2022.*)
73+
elif [[ "${{ matrix.unity-version }}" =~ ^([0-9]+)\.[x\*]$ ]]; then
7474
UNITY_MAJOR="${BASH_REMATCH[1]}"
7575
if [[ "$UNITY_EDITOR_VERSION" == "$UNITY_MAJOR"* ]]; then
7676
echo "Unity version matches matrix.unity-version: $UNITY_EDITOR_VERSION satisfies ${{ matrix.unity-version }}"

dist/index.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,8 +3287,9 @@ async function getSdkManager(rootEditorPath) {
32873287
}
32883288
async function getAndroidSdkPath(rootEditorPath, androidTargetSdk) {
32893289
logger.ci(`Attempting to locate Android SDK Path...\n > editorPath: ${rootEditorPath}\n > androidTargetSdk: ${androidTargetSdk}`);
3290-
const sdkPath = await (0, utilities_1.ResolveGlobToPath)([rootEditorPath, '**', 'PlaybackEngines', 'AndroidPlayer', 'SDK', 'platforms', `android-${androidTargetSdk}/`]);
3290+
let sdkPath;
32913291
try {
3292+
sdkPath = await (0, utilities_1.ResolveGlobToPath)([rootEditorPath, '**', 'PlaybackEngines', 'AndroidPlayer', 'SDK', 'platforms', `android-${androidTargetSdk}/`]);
32923293
await fs_1.default.promises.access(sdkPath, fs_1.default.constants.R_OK);
32933294
}
32943295
catch (error) {
@@ -4677,19 +4678,23 @@ class UnityHub {
46774678
finally {
46784679
this.logger.endGroup();
46794680
const match = output.match(/Assertion (?<assert>.+) failed/g);
4681+
const retryConditions = [
4682+
'async hook stack has become corrupted',
4683+
'failed to download'
4684+
];
46804685
if (match ||
4681-
output.includes('async hook stack has become corrupted')) {
4686+
retryConditions.some(s => output.includes(s))) {
46824687
this.logger.warn(`Install failed, retrying...`);
46834688
return await this.Exec(args);
46844689
}
4685-
if (exitCode > 0 || output.includes('Error:')) {
4686-
const error = output.match(/Error: (.+)/);
4690+
if (exitCode > 0 || output.includes('Error')) {
4691+
const error = output.match(/Error(?: given)?:\s*(.+)/);
46874692
const errorMessage = error && error[1] ? error[1] : 'Unknown Error';
46884693
switch (errorMessage) {
46894694
case 'No modules found to install.':
46904695
break;
46914696
default:
4692-
throw new Error(`Failed to execute Unity Hub: [${exitCode}] ${errorMessage}`);
4697+
throw new Error(`Failed to execute Unity Hub (exit code: ${exitCode}) ${errorMessage}`);
46934698
}
46944699
}
46954700
output = output.split('\n')
@@ -5318,12 +5323,12 @@ done
53185323
return JSON.parse(modulesContent);
53195324
}
53205325
async installUnity(unityVersion, modules) {
5321-
this.logger.ci(`Installing Unity ${unityVersion.toString()}...`);
53225326
if (unityVersion.isLegacy()) {
53235327
return await this.installUnity4x(unityVersion);
53245328
}
53255329
if (process.platform === 'linux') {
53265330
const arch = process.arch === 'x64' ? 'amd64' : process.arch === 'arm64' ? 'arm64' : process.arch;
5331+
// install older versions of libssl for older Unity versions
53275332
if (['2019.1', '2019.2'].some(v => unityVersion.version.startsWith(v))) {
53285333
const url = `https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb`;
53295334
const downloadPath = path.join((0, utilities_1.GetTempDir)(), `libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb`);
@@ -5349,6 +5354,7 @@ done
53495354
}
53505355
}
53515356
}
5357+
this.logger.ci(`Installing Unity ${unityVersion.toString()}...`);
53525358
const args = ['install', '--version', unityVersion.version];
53535359
if (unityVersion.changeset) {
53545360
args.push('--changeset', unityVersion.changeset);
@@ -5364,11 +5370,13 @@ done
53645370
args.push('--cm');
53655371
}
53665372
const output = await this.Exec(args, { showCommand: true, silent: false });
5367-
if (output.includes(`Error while installing an editor or a module from changeset`)) {
5373+
if (output.includes(`Error while installing an editor or a module from changeset`) ||
5374+
output.includes(`failed to download.`)) {
53685375
throw new Error(`Failed to install Unity ${unityVersion.toString()}`);
53695376
}
53705377
}
53715378
async installUnity4x(unityVersion) {
5379+
this.logger.ci(`Installing Unity ${unityVersion.toString()}...`);
53725380
const hubInstallDir = await this.GetInstallPath();
53735381
switch (process.platform) {
53745382
case 'win32': {

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: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-setup",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",
@@ -27,12 +27,12 @@
2727
"@actions/core": "^1.11.1",
2828
"@actions/exec": "^1.1.1",
2929
"@actions/glob": "^0.5.0",
30-
"@rage-against-the-pixel/unity-cli": "^1.3.0",
30+
"@rage-against-the-pixel/unity-cli": "^1.3.1",
3131
"semver": "^7.7.3",
3232
"yaml": "^2.8.1"
3333
},
3434
"devDependencies": {
35-
"@types/node": "^22.18.8",
35+
"@types/node": "^22.18.10",
3636
"@types/semver": "^7.7.1",
3737
"@vercel/ncc": "^0.34.0",
3838
"shx": "^0.4.0",

0 commit comments

Comments
 (0)