Refactor models to allow for build parameters...

Build parameters have to be parsed because they can no longer be implicitly passed, as they need to be interpreted for detecting extensions.
This commit is contained in:
Webber
2020-01-21 00:06:14 +01:00
committed by Webber Takken
parent a84535fc04
commit 1d1f81c0bb
10 changed files with 172 additions and 95 deletions

View File

@@ -1,22 +1,26 @@
import Platform from './platform';
const core = require('@actions/core');
export default class Input {
class Input {
static getFromUser() {
// Input variables specified in workflows using "with" prop.
const version = core.getInput('unityVersion');
const platform = core.getInput('targetPlatform');
const unityVersion = core.getInput('unityVersion');
const targetPlatform = core.getInput('targetPlatform') || Platform.default;
const projectPath = core.getInput('projectPath');
const buildName = core.getInput('buildName');
const buildsPath = core.getInput('buildsPath');
const buildMethod = core.getInput('buildMethod');
const buildName = core.getInput('buildName') || targetPlatform;
const buildsPath = core.getInput('buildsPath') || 'build';
const buildMethod = core.getInput('buildMethod'); // processed in docker file
return {
version,
platform,
unityVersion,
targetPlatform,
projectPath,
buildName,
buildsPath,
method: buildMethod,
buildMethod,
};
}
}
export default Input;