Add initial script

This commit is contained in:
Webber
2019-12-17 00:53:39 +01:00
committed by Webber Takken
parent 25294aec32
commit 302bd4c880
2 changed files with 94 additions and 0 deletions

48
src/index.js Normal file
View File

@@ -0,0 +1,48 @@
const core = require('@actions/core');
const path = require('path');
const { exec } = require('@actions/exec');
async function action() {
// Path to the project to open with Unity
const projectPath = core.getInput('projectPath', {
required: false,
default: './',
});
// Target platform for the build
const buildTarget = core.getInput('buildTarget', {
required: false,
default: 'WebGL',
});
// Name of the build
const buildName = core.getInput('buildName', {
required: false,
default: 'TestBuild',
});
// Path where build will be stored
const buildsPath = core.getInput('buildsPath', {
required: false,
default: 'build',
});
// Method to execute within unity. Must be static
const buildMethod = core.getInput('buildMethod', {
required: false,
default: '',
});
// Run appropriate docker image with given args
await exec(path.join(__dirname, 'run-unity-builder.sh'), [
projectPath,
buildTarget,
buildName,
buildsPath,
buildMethod,
]);
}
action().catch(error => {
core.setFailed(error.message);
});