Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36281,20 +36281,26 @@ async function checkInstalledEditors(unityVersion, failOnEmpty, installPath = un
if (paths.length !== matches.length) {
throw new Error(`Failed to parse all installed Unity Editors!`);
}
const versionMatches = matches.filter(match => unityVersion.satisfies(match.groups.version));
core.debug(`Version Matches: ${JSON.stringify(versionMatches, null, 2)}`);
if (versionMatches.length === 0) {
return undefined;
}
for (const match of versionMatches) {
if (!unityVersion.architecture || !match.groups.arch) {
editorPath = match.groups.editorPath;
}
else if (archMap[unityVersion.architecture] === match.groups.arch) {
editorPath = match.groups.editorPath;
const exactMatch = matches.find(match => match.groups.version === unityVersion.version);
if (exactMatch) {
editorPath = exactMatch.groups.editorPath;
}
else {
const versionMatches = matches.filter(match => unityVersion.satisfies(match.groups.version));
core.debug(`Version Matches: ${JSON.stringify(versionMatches, null, 2)}`);
if (versionMatches.length === 0) {
return undefined;
}
else if (unityVersion.architecture && match.groups.editorPath.toLowerCase().includes(`-${unityVersion.architecture.toLowerCase()}`)) {
editorPath = match.groups.editorPath;
for (const match of versionMatches) {
if (!unityVersion.architecture || !match.groups.arch) {
editorPath = match.groups.editorPath;
}
else if (archMap[unityVersion.architecture] === match.groups.arch) {
editorPath = match.groups.editorPath;
}
else if (unityVersion.architecture && match.groups.editorPath.toLowerCase().includes(`-${unityVersion.architecture.toLowerCase()}`)) {
editorPath = match.groups.editorPath;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unity-setup",
"version": "1.2.2",
"version": "1.2.3",
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
"author": "Buildalon",
"license": "MIT",
Expand Down
39 changes: 23 additions & 16 deletions src/unity-hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,23 +449,30 @@ async function checkInstalledEditors(unityVersion: UnityVersion, failOnEmpty: bo
if (paths.length !== matches.length) {
throw new Error(`Failed to parse all installed Unity Editors!`);
}
const versionMatches = matches.filter(match => unityVersion.satisfies(match.groups.version));
core.debug(`Version Matches: ${JSON.stringify(versionMatches, null, 2)}`);
if (versionMatches.length === 0) {
return undefined;
}
for (const match of versionMatches) {
// If no architecture is set, or no arch in match, accept the version match
if (!unityVersion.architecture || !match.groups.arch) {
editorPath = match.groups.editorPath;
}
// If architecture is set and present in match, check for match
else if (archMap[unityVersion.architecture] === match.groups.arch) {
editorPath = match.groups.editorPath;
// Prefer exact version match first
const exactMatch = matches.find(match => match.groups.version === unityVersion.version);
if (exactMatch) {
editorPath = exactMatch.groups.editorPath;
} else {
// Fallback: semver satisfies
const versionMatches = matches.filter(match => unityVersion.satisfies(match.groups.version));
core.debug(`Version Matches: ${JSON.stringify(versionMatches, null, 2)}`);
if (versionMatches.length === 0) {
return undefined;
}
// Fallback: check if editorPath includes architecture string (case-insensitive)
else if (unityVersion.architecture && match.groups.editorPath.toLowerCase().includes(`-${unityVersion.architecture.toLowerCase()}`)) {
editorPath = match.groups.editorPath;
for (const match of versionMatches) {
// If no architecture is set, or no arch in match, accept the version match
if (!unityVersion.architecture || !match.groups.arch) {
editorPath = match.groups.editorPath;
}
// If architecture is set and present in match, check for match
else if (archMap[unityVersion.architecture] === match.groups.arch) {
editorPath = match.groups.editorPath;
}
// Fallback: check if editorPath includes architecture string (case-insensitive)
else if (unityVersion.architecture && match.groups.editorPath.toLowerCase().includes(`-${unityVersion.architecture.toLowerCase()}`)) {
editorPath = match.groups.editorPath;
}
}
}
}
Expand Down
Loading