Merge 3255669e84
into 61fd9aa167
commit
1c3d905ea7
|
@ -90,6 +90,13 @@ inputs:
|
|||
required: false
|
||||
default: ''
|
||||
description: 'Url to a unity license server for acquiring floating licenses.'
|
||||
unityLicensingProductIds:
|
||||
required: false
|
||||
default: ''
|
||||
description:
|
||||
'Comma separated list of license product identifiers to request licenses for from the license server. Not setting
|
||||
this will request the default license product configured on the licensing server. Only applicable if
|
||||
unityLicensingServer is set.'
|
||||
containerRegistryRepository:
|
||||
required: false
|
||||
default: 'unityci/editor'
|
||||
|
|
|
@ -47,7 +47,7 @@ function run() {
|
|||
try {
|
||||
model_1.Action.checkCompatibility();
|
||||
const { workspace, actionFolder } = model_1.Action;
|
||||
const { editorVersion, customImage, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, githubToken, checkName, packageMode, packageName, scopedRegistryUrl, registryScopes, chownFilesTo, dockerCpuLimit, dockerMemoryLimit, dockerIsolationMode, unityLicensingServer, runAsHostUser, containerRegistryRepository, containerRegistryImageVersion, unitySerial, } = model_1.Input.getFromUser();
|
||||
const { editorVersion, customImage, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, githubToken, checkName, packageMode, packageName, scopedRegistryUrl, registryScopes, chownFilesTo, dockerCpuLimit, dockerMemoryLimit, dockerIsolationMode, unityLicensingServer, unityLicensingProductIds, runAsHostUser, containerRegistryRepository, containerRegistryImageVersion, unitySerial, } = model_1.Input.getFromUser();
|
||||
const baseImage = new model_1.ImageTag({
|
||||
editorVersion,
|
||||
customImage,
|
||||
|
@ -78,6 +78,7 @@ function run() {
|
|||
dockerMemoryLimit,
|
||||
dockerIsolationMode,
|
||||
unityLicensingServer,
|
||||
unityLicensingProductIds,
|
||||
runAsHostUser,
|
||||
unitySerial }, runnerContext));
|
||||
}
|
||||
|
@ -209,7 +210,7 @@ const Docker = {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let runCommand = '';
|
||||
if (parameters.unityLicensingServer !== '') {
|
||||
licensing_server_setup_1.default.Setup(parameters.unityLicensingServer, parameters.actionFolder);
|
||||
licensing_server_setup_1.default.Setup(parameters.unityLicensingServer, parameters.actionFolder, parameters.unityLicensingProductIds);
|
||||
}
|
||||
switch (process.platform) {
|
||||
case 'linux':
|
||||
|
@ -338,6 +339,7 @@ class ImageEnvironmentFactory {
|
|||
name: 'UNITY_LICENSING_SERVER',
|
||||
value: parameters.unityLicensingServer,
|
||||
},
|
||||
{ name: 'UNITY_LICENSING_PRODUCT_IDS', value: parameters.unityLicensingProductIds },
|
||||
{ name: 'UNITY_VERSION', value: parameters.editorVersion },
|
||||
{
|
||||
name: 'USYM_UPLOAD_AUTH_TOKEN',
|
||||
|
@ -651,6 +653,7 @@ class Input {
|
|||
const customImage = (0, core_1.getInput)('customImage') || '';
|
||||
const rawProjectPath = (0, core_1.getInput)('projectPath') || '.';
|
||||
const unityLicensingServer = (0, core_1.getInput)('unityLicensingServer') || '';
|
||||
const unityLicensingProductIds = (0, core_1.getInput)('unityLicensingProductIds') || '';
|
||||
const unityLicense = (0, core_1.getInput)('unityLicense') || ((_a = process.env['UNITY_LICENSE']) !== null && _a !== void 0 ? _a : '');
|
||||
let unitySerial = (_b = process.env['UNITY_SERIAL']) !== null && _b !== void 0 ? _b : '';
|
||||
const customParameters = (0, core_1.getInput)('customParameters') || '';
|
||||
|
@ -775,6 +778,7 @@ class Input {
|
|||
dockerMemoryLimit,
|
||||
dockerIsolationMode,
|
||||
unityLicensingServer,
|
||||
unityLicensingProductIds,
|
||||
runAsHostUser,
|
||||
containerRegistryRepository,
|
||||
containerRegistryImageVersion,
|
||||
|
@ -822,7 +826,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
||||
class LicensingServerSetup {
|
||||
static Setup(unityLicensingServer, actionFolder) {
|
||||
static Setup(unityLicensingServer, actionFolder, unityLicensingProductIds) {
|
||||
const servicesConfigPath = `${actionFolder}/unity-config/services-config.json`;
|
||||
const servicesConfigPathTemplate = `${servicesConfigPath}.template`;
|
||||
if (!fs_1.default.existsSync(servicesConfigPathTemplate)) {
|
||||
|
@ -831,6 +835,7 @@ class LicensingServerSetup {
|
|||
}
|
||||
let servicesConfig = fs_1.default.readFileSync(servicesConfigPathTemplate).toString();
|
||||
servicesConfig = servicesConfig.replace('%URL%', unityLicensingServer);
|
||||
servicesConfig = servicesConfig.replace('%LICENSE_PRODUCT_IDS%', unityLicensingProductIds);
|
||||
fs_1.default.writeFileSync(servicesConfigPath, servicesConfig);
|
||||
}
|
||||
}
|
||||
|
@ -1016,7 +1021,7 @@ const ResultsCheck = {
|
|||
core.info(`Processing file ${filepath}...`);
|
||||
try {
|
||||
const content = fs.readFileSync(path_1.default.join(artifactsPath, filepath), 'utf8');
|
||||
if (!content.includes('<test-results') && !content.includes('<test-run')) {
|
||||
if (!content.includes('<test-run')) {
|
||||
// noinspection ExceptionCaughtLocallyJS
|
||||
throw new Error('File does not appear to be a NUnit XML file');
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,5 +3,6 @@
|
|||
"enableEntitlementLicensing": true,
|
||||
"enableFloatingApi": true,
|
||||
"clientConnectTimeoutSec": 5,
|
||||
"clientHandshakeTimeoutSec": 10
|
||||
"clientHandshakeTimeoutSec": 10,
|
||||
"toolset": "%LICENSE_PRODUCT_IDS%"
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ export async function run() {
|
|||
dockerMemoryLimit,
|
||||
dockerIsolationMode,
|
||||
unityLicensingServer,
|
||||
unityLicensingProductIds,
|
||||
runAsHostUser,
|
||||
containerRegistryRepository,
|
||||
containerRegistryImageVersion,
|
||||
|
@ -66,6 +67,7 @@ export async function run() {
|
|||
dockerMemoryLimit,
|
||||
dockerIsolationMode,
|
||||
unityLicensingServer,
|
||||
unityLicensingProductIds,
|
||||
runAsHostUser,
|
||||
unitySerial,
|
||||
...runnerContext,
|
||||
|
|
|
@ -34,7 +34,11 @@ const Docker = {
|
|||
let runCommand = '';
|
||||
|
||||
if (parameters.unityLicensingServer !== '') {
|
||||
LicensingServerSetup.Setup(parameters.unityLicensingServer, parameters.actionFolder);
|
||||
LicensingServerSetup.Setup(
|
||||
parameters.unityLicensingServer,
|
||||
parameters.actionFolder,
|
||||
parameters.unityLicensingProductIds,
|
||||
);
|
||||
}
|
||||
|
||||
switch (process.platform) {
|
||||
|
|
|
@ -27,6 +27,7 @@ class ImageEnvironmentFactory {
|
|||
name: 'UNITY_LICENSING_SERVER',
|
||||
value: parameters.unityLicensingServer,
|
||||
},
|
||||
{ name: 'UNITY_LICENSING_PRODUCT_IDS', value: parameters.unityLicensingProductIds },
|
||||
{ name: 'UNITY_VERSION', value: parameters.editorVersion },
|
||||
{
|
||||
name: 'USYM_UPLOAD_AUTH_TOKEN',
|
||||
|
|
|
@ -87,6 +87,7 @@ class Input {
|
|||
const customImage = getInput('customImage') || '';
|
||||
const rawProjectPath = getInput('projectPath') || '.';
|
||||
const unityLicensingServer = getInput('unityLicensingServer') || '';
|
||||
const unityLicensingProductIds = getInput('unityLicensingProductIds') || '';
|
||||
const unityLicense = getInput('unityLicense') || (process.env['UNITY_LICENSE'] ?? '');
|
||||
let unitySerial = process.env['UNITY_SERIAL'] ?? '';
|
||||
const customParameters = getInput('customParameters') || '';
|
||||
|
@ -239,6 +240,7 @@ class Input {
|
|||
dockerMemoryLimit,
|
||||
dockerIsolationMode,
|
||||
unityLicensingServer,
|
||||
unityLicensingProductIds,
|
||||
runAsHostUser,
|
||||
containerRegistryRepository,
|
||||
containerRegistryImageVersion,
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
import fs from 'fs';
|
||||
|
||||
class LicensingServerSetup {
|
||||
public static Setup(unityLicensingServer, actionFolder: string) {
|
||||
public static Setup(
|
||||
unityLicensingServer,
|
||||
actionFolder: string,
|
||||
unityLicensingProductIds: string,
|
||||
) {
|
||||
const servicesConfigPath = `${actionFolder}/unity-config/services-config.json`;
|
||||
const servicesConfigPathTemplate = `${servicesConfigPath}.template`;
|
||||
if (!fs.existsSync(servicesConfigPathTemplate)) {
|
||||
|
@ -13,6 +17,7 @@ class LicensingServerSetup {
|
|||
|
||||
let servicesConfig = fs.readFileSync(servicesConfigPathTemplate).toString();
|
||||
servicesConfig = servicesConfig.replace('%URL%', unityLicensingServer);
|
||||
servicesConfig = servicesConfig.replace('%LICENSE_PRODUCT_IDS%', unityLicensingProductIds);
|
||||
fs.writeFileSync(servicesConfigPath, servicesConfig);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue