Skip to content

Commit 4b8bbee

Browse files
unity-setup@v1.0.12 (#15)
- fix version matching to only match against release versions only, not alpha/beta channels unless specifically requested
1 parent 3f4b1b2 commit 4b8bbee

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
27+
os: [ubuntu-latest, windows-latest, macos-latest]
2828
unity-versions:
2929
- None
3030
- 2019.4.40f1 (ffc62b691db5)

dist/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34834,7 +34834,12 @@ async function getLatestRelease(version, isSilicon) {
3483434834
for (const release of validReleases) {
3483534835
const originalRelease = releases.find(r => r.includes(release.version));
3483634836
const match = originalRelease.match(/(?<version>\d+\.\d+\.\d+[fab]?\d*)\s*(?:\((?<arch>Apple silicon|Intel)\))?/);
34837-
if (match && match.groups && match.groups.version) {
34837+
if (!(match && match.groups && match.groups.version)) {
34838+
continue;
34839+
}
34840+
if ((version.includes('a') && match.groups.version.includes('a')) ||
34841+
(version.includes('b') && match.groups.version.includes('b')) ||
34842+
match.groups.version.includes('f')) {
3483834843
core.info(`Found Unity ${match.groups.version}`);
3483934844
return [match.groups.version, undefined];
3484034845
}

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.11",
3+
"version": "1.0.12",
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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ async function getLatestRelease(version: string, isSilicon: boolean): Promise<[s
271271
for (const release of validReleases) {
272272
const originalRelease = releases.find(r => r.includes(release.version));
273273
const match = originalRelease.match(/(?<version>\d+\.\d+\.\d+[fab]?\d*)\s*(?:\((?<arch>Apple silicon|Intel)\))?/);
274-
if (match && match.groups && match.groups.version) {
274+
if (!(match && match.groups && match.groups.version)) { continue; }
275+
if ((version.includes('a') && match.groups.version.includes('a')) ||
276+
(version.includes('b') && match.groups.version.includes('b')) ||
277+
match.groups.version.includes('f')) {
275278
core.info(`Found Unity ${match.groups.version}`);
276279
return [match.groups.version, undefined];
277280
}
@@ -289,7 +292,7 @@ async function getLatestRelease(version: string, isSilicon: boolean): Promise<[s
289292
async function parseReleases(version: string, data: string): Promise<[string, string]> {
290293
const releases = JSON.parse(data);
291294
core.debug(`Found ${releases.official.length} official releases...`);
292-
releases.official.sort((a, b) => semver.compare(a.version, b.version, true));
295+
releases.official.sort((a: any, b: any) => semver.compare(a.version, b.version, true));
293296
for (const release of releases.official) {
294297
const semVersion = semver.coerce(version);
295298
const semVerRelease = semver.coerce(release.version);

0 commit comments

Comments
 (0)