This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59b8ac3
commit a87d6be
Showing
15 changed files
with
10 additions
and
1,697 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26156,34 +26156,18 @@ exports["default"] = _default; | |
|
||
const core = __nccwpck_require__(2186); | ||
const exec = __nccwpck_require__(1514); | ||
const io = __nccwpck_require__(7436); | ||
const fs = __nccwpck_require__(7147); | ||
const path = __nccwpck_require__(1017); | ||
const { readdir } = __nccwpck_require__(3292); | ||
const platform = process.platform; | ||
|
||
async function retry(fn, retries = 3) { | ||
let lastError; | ||
for (let i = 0; i < retries; i++) { | ||
try { | ||
await fn(); | ||
return; | ||
} catch (error) { | ||
lastError = error; | ||
core.warning(`Attempt ${i + 1} failed: ${error.message}`); | ||
await new Promise(r => setTimeout(r, 2000 * i)); | ||
} | ||
} | ||
throw lastError; | ||
} | ||
|
||
async function Run() { | ||
try { | ||
if (hasExistingLicense()) { | ||
core.info('Unity License already activated!'); | ||
return; | ||
} else { | ||
core.info('Attempting to activate Unity License...'); | ||
core.debug('Attempting to activate Unity License...'); | ||
} | ||
|
||
var editorPath = process.env.UNITY_EDITOR_PATH; | ||
|
@@ -26230,68 +26214,13 @@ async function Run() { | |
throw Error('Unable to find Unity License!'); | ||
} | ||
|
||
var entitlements = ''; | ||
await exec.exec(`"${licenseClient}" --showEntitlements`, { | ||
listeners: { | ||
stdout: (data) => { | ||
entitlements += data.toString(); | ||
} | ||
} | ||
}); | ||
var serial = entitlements.match(/EntitlementGroupId: ([A-Z0-9-]+)/)[1]; | ||
var maskedSerial = serial.slice(0, -4) + `XXXX`; | ||
core.setSecret(maskedSerial); | ||
await exec.exec(`"${licenseClient}" --showEntitlements`); | ||
} catch (error) { | ||
core.setFailed(`Unity License Activation Failed! ${error.message}`); | ||
GetLogs(); | ||
} | ||
} | ||
|
||
const findByExtension = async (dir, ext) => { | ||
const directories = []; | ||
const matchedFiles = []; | ||
const files = await readdir(dir); | ||
|
||
for (const file of files) { | ||
const item = path.resolve(dir, file); | ||
|
||
if (fs.statSync(`${dir}/${file}`).isDirectory()) { | ||
directories.push(item); | ||
} else if (file.endsWith(ext)) { | ||
core.debug(`--> Found! ${item}`); | ||
matchedFiles.push(item); | ||
break; | ||
} | ||
} | ||
|
||
if (matchedFiles.length == 0) { | ||
for (const subDir of directories) { | ||
const nestedMatches = await findByExtension(subDir, ext); | ||
|
||
for (const nestedMatch of nestedMatches) { | ||
matchedFiles.push(nestedMatch); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
return matchedFiles; | ||
}; | ||
|
||
const findWorkspace = async (dir) => { | ||
core.debug(`Searching for .git root in: ${dir}`); | ||
const files = await readdir(dir); | ||
|
||
for (const file of files) { | ||
if (file.match('\.git')) { | ||
return path.resolve(dir); | ||
} | ||
} | ||
|
||
const result = await findWorkspace(path.resolve(dir, '..')); | ||
return result; | ||
}; | ||
|
||
const getLicensingClient = () => { | ||
// Windows: <UnityEditorDir>\Data\Resources\Licensing\Client | ||
// macOS (Editor versions 2021.3.19f1 or later): <UnityEditorDir>/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/ | ||
|
@@ -26496,7 +26425,7 @@ async function Run() { | |
} | ||
|
||
var pwsh = await io.which("pwsh", true); | ||
var unity_action = __nccwpck_require__.ab + "unity-action.ps1"; | ||
var unity_action = path.resolve(__dirname, 'unity-action.ps1'); | ||
// -quit -batchmode -nographics -returnlicense -username [email protected] -password XXXXXXXXXXXXX | ||
var args = `-quit -batchmode -nographics -returnlicense -username ${username} -password ${password}`; | ||
var exitCode = 0; | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.