unity-builder/src/model/input.js

122 lines
2.7 KiB
JavaScript
Raw Normal View History

import Platform from './platform';
2019-12-22 14:05:15 +00:00
const core = require('@actions/core');
/**
* Input variables specified in workflows using "with" prop.
*
* Note that input is always passed as a string, even booleans.
*/
class Input {
static get unityVersion() {
return core.getInput('unityVersion') || 'auto';
}
static get customImage() {
return core.getInput('customImage');
}
static get targetPlatform() {
return core.getInput('targetPlatform') || Platform.default;
}
static get projectPath() {
const rawProjectPath = core.getInput('projectPath') || '.';
return rawProjectPath.replace(/\/$/, '');
}
static get buildName() {
return core.getInput('buildName') || this.targetPlatform;
}
static get buildsPath() {
return core.getInput('buildsPath') || 'build';
}
static get buildMethod() {
return core.getInput('buildMethod'); // processed in docker file
}
static get versioningStrategy() {
return core.getInput('versioning') || 'Semantic';
}
static get specifiedVersion() {
return core.getInput('version') || '';
}
static get androidVersionCode() {
return core.getInput('androidVersionCode');
}
2020-07-06 01:41:21 +00:00
static get androidAppBundle() {
2020-08-10 14:30:06 +00:00
const input = core.getInput('androidAppBundle') || false;
2020-07-06 01:41:21 +00:00
2020-08-10 14:30:06 +00:00
return input === 'true';
2020-07-06 01:41:21 +00:00
}
static get androidKeystoreName() {
return core.getInput('androidKeystoreName') || '';
}
static get androidKeystoreBase64() {
return core.getInput('androidKeystoreBase64') || '';
}
static get androidKeystorePass() {
return core.getInput('androidKeystorePass') || '';
}
static get androidKeyaliasName() {
return core.getInput('androidKeyaliasName') || '';
}
static get androidKeyaliasPass() {
return core.getInput('androidKeyaliasPass') || '';
}
static get allowDirtyBuild() {
2020-08-10 14:30:06 +00:00
const input = core.getInput('allowDirtyBuild') || false;
2020-08-10 14:30:06 +00:00
return input === 'true';
}
static get customParameters() {
return core.getInput('customParameters') || '';
2019-12-22 14:05:15 +00:00
}
2021-01-31 19:22:28 +00:00
static get remote() {
2021-01-31 19:47:42 +00:00
return core.getInput('remote') || '';
2021-01-31 19:22:28 +00:00
}
static get awsStackName() {
return core.getInput('awsStackName') || '';
}
static get kubeConfig() {
return core.getInput('kubeConfig') || '';
}
2021-02-14 21:27:25 +00:00
static get githubToken() {
2021-02-14 21:38:12 +00:00
return core.getInput('githubToken') || '';
2021-02-14 21:27:25 +00:00
}
static get kubeContainerMemory() {
return core.getInput('kubeContainerMemory') || '800M';
}
static get kubeContainerCPU() {
return core.getInput('kubeContainerCPU') || '0.25';
}
static get kubeVolumeSize() {
return core.getInput('kubeVolumeSize') || '5Gi';
}
static get kubeVolume() {
return core.getInput('kubeVolume') || '';
}
2019-12-22 14:05:15 +00:00
}
export default Input;