Merge branch 'main' of https://github.com/webbertakken/unity-builder into fix/unity-alias
This commit is contained in:
@@ -16,13 +16,7 @@ async function action() {
|
||||
} else {
|
||||
// Build docker image
|
||||
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
|
||||
const builtImage = await Docker.build({
|
||||
path: actionFolder,
|
||||
dockerfile,
|
||||
baseImage,
|
||||
uid: buildParameters.uid,
|
||||
gid: buildParameters.gid,
|
||||
});
|
||||
const builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
await Docker.run(builtImage, { workspace, ...buildParameters });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import os from 'os';
|
||||
import AndroidVersioning from './android-versioning';
|
||||
import Input from './input';
|
||||
import Platform from './platform';
|
||||
@@ -21,13 +20,10 @@ class BuildParameters {
|
||||
Input.androidVersionCode,
|
||||
);
|
||||
|
||||
const { uid, gid } = os.userInfo();
|
||||
|
||||
return {
|
||||
version: Input.unityVersion,
|
||||
customImage: Input.customImage,
|
||||
uid,
|
||||
gid,
|
||||
|
||||
runnerTempPath: process.env.RUNNER_TEMP,
|
||||
platform: Input.targetPlatform,
|
||||
projectPath: Input.projectPath,
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import fs from 'fs';
|
||||
import { exec } from '@actions/exec';
|
||||
import ImageTag from './image-tag';
|
||||
|
||||
class Docker {
|
||||
static async build(buildParameters, silent = false) {
|
||||
const { path, dockerfile, baseImage, uid, gid } = buildParameters;
|
||||
const { path, dockerfile, baseImage } = buildParameters;
|
||||
const { version, platform } = baseImage;
|
||||
|
||||
const tag = new ImageTag({ repository: '', name: 'unity-builder', version, platform });
|
||||
const command = `docker build ${path} \
|
||||
--file ${dockerfile} \
|
||||
--build-arg IMAGE=${baseImage} \
|
||||
--build-arg UID=${uid} \
|
||||
--build-arg GID=${gid} \
|
||||
--tag ${tag}`;
|
||||
|
||||
await exec(command, undefined, { silent });
|
||||
@@ -86,9 +83,6 @@ class Docker {
|
||||
--volume "${workspace}":"/github/workspace" \
|
||||
${image}`;
|
||||
|
||||
fs.mkdirSync(`${runnerTempPath}/_github_home`, { recursive: true });
|
||||
fs.mkdirSync(`${runnerTempPath}/_github_workflow`, { recursive: true });
|
||||
|
||||
await exec(command, undefined, { silent });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user