fix push to cache
parent
74ffe357fe
commit
c405971de3
|
|
@ -4711,16 +4711,19 @@ class BuildAutomationWorkflow {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
static ToLinuxFolder(folder) {
|
||||||
|
return folder.replace(/\\/g, `/`);
|
||||||
|
}
|
||||||
static get BuildWorkflow() {
|
static get BuildWorkflow() {
|
||||||
const setupHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customJobHooks).filter((x) => x.step.includes(`setup`));
|
const setupHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customJobHooks).filter((x) => x.step.includes(`setup`));
|
||||||
const buildHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customJobHooks).filter((x) => x.step.includes(`build`));
|
const buildHooks = cloud_runner_custom_hooks_1.CloudRunnerCustomHooks.getHooks(cloud_runner_1.default.buildParameters.customJobHooks).filter((x) => x.step.includes(`build`));
|
||||||
const builderPath = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', `index.js`).replace(/\\/g, `/`);
|
const builderPath = BuildAutomationWorkflow.ToLinuxFolder(path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', `index.js`));
|
||||||
return `apt-get update > /dev/null
|
return `apt-get update > /dev/null
|
||||||
apt-get install -y tar tree npm git-lfs jq git > /dev/null
|
apt-get install -y tar tree npm git-lfs jq git > /dev/null
|
||||||
npm install -g n > /dev/null
|
npm install -g n > /dev/null
|
||||||
n stable > /dev/null
|
n stable > /dev/null
|
||||||
${setupHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
${setupHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||||
export GITHUB_WORKSPACE="${cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute.replace(/\\/g, `/`)}"
|
export GITHUB_WORKSPACE="${BuildAutomationWorkflow.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}"
|
||||||
${BuildAutomationWorkflow.setupCommands(builderPath)}
|
${BuildAutomationWorkflow.setupCommands(builderPath)}
|
||||||
${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
||||||
${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||||
|
|
@ -4730,23 +4733,23 @@ class BuildAutomationWorkflow {
|
||||||
static setupCommands(builderPath) {
|
static setupCommands(builderPath) {
|
||||||
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||||
echo "game ci cloud runner clone"
|
echo "game ci cloud runner clone"
|
||||||
mkdir -p ${cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute.replace(/\\/g, `/`)}
|
mkdir -p ${BuildAutomationWorkflow.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute)}
|
||||||
git clone -q -b ${cloud_runner_1.default.buildParameters.cloudRunnerBranch} ${cloud_runner_folders_1.CloudRunnerFolders.unityBuilderRepoUrl} "${cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute.replace(/\\/g, `/`)}"
|
git clone -q -b ${cloud_runner_1.default.buildParameters.cloudRunnerBranch} ${cloud_runner_folders_1.CloudRunnerFolders.unityBuilderRepoUrl} "${BuildAutomationWorkflow.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute)}"
|
||||||
chmod +x ${builderPath}
|
chmod +x ${builderPath}
|
||||||
echo "game ci cloud runner bootstrap"
|
echo "game ci cloud runner bootstrap"
|
||||||
node ${builderPath} -m remote-cli`;
|
node ${builderPath} -m remote-cli`;
|
||||||
}
|
}
|
||||||
// ToDo: Replace with a very simple "node ${builderPath} -m build-cli" to run the scripts below without enlarging the request size
|
// ToDo: Replace with a very simple "node ${builderPath} -m build-cli" to run the scripts below without enlarging the request size
|
||||||
static BuildCommands(builderPath, guid) {
|
static BuildCommands(builderPath, guid) {
|
||||||
const linuxCacheFolder = cloud_runner_folders_1.CloudRunnerFolders.cacheFolderFull.replace(/\\/g, `/`);
|
const linuxCacheFolder = BuildAutomationWorkflow.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.cacheFolderFull);
|
||||||
const distFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist');
|
const distFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist');
|
||||||
const ubuntuPlatformsFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
|
const ubuntuPlatformsFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
|
||||||
return `echo "game ci cloud runner init"
|
return `echo "game ci cloud runner init"
|
||||||
mkdir -p ${`${cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute}/build`.replace(/\\/g, `/`)}
|
mkdir -p ${`${BuildAutomationWorkflow.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute)}/build`}
|
||||||
cd ${cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute}
|
cd ${cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute}
|
||||||
cp -r "${path_1.default.join(distFolder, 'default-build-script').replace(/\\/g, `/`)}" "/UnityBuilderAction"
|
cp -r "${BuildAutomationWorkflow.ToLinuxFolder(path_1.default.join(distFolder, 'default-build-script'))}" "/UnityBuilderAction"
|
||||||
cp -r "${path_1.default.join(ubuntuPlatformsFolder, 'entrypoint.sh').replace(/\\/g, `/`)}" "/entrypoint.sh"
|
cp -r "${BuildAutomationWorkflow.ToLinuxFolder(path_1.default.join(ubuntuPlatformsFolder, 'entrypoint.sh'))}" "/entrypoint.sh"
|
||||||
cp -r "${path_1.default.join(ubuntuPlatformsFolder, 'steps').replace(/\\/g, `/`)}" "/steps"
|
cp -r "${BuildAutomationWorkflow.ToLinuxFolder(path_1.default.join(ubuntuPlatformsFolder, 'steps'))}" "/steps"
|
||||||
chmod -R +x "/entrypoint.sh"
|
chmod -R +x "/entrypoint.sh"
|
||||||
chmod -R +x "/steps"
|
chmod -R +x "/steps"
|
||||||
echo "game ci cloud runner start"
|
echo "game ci cloud runner start"
|
||||||
|
|
@ -4755,7 +4758,7 @@ class BuildAutomationWorkflow {
|
||||||
chmod +x ${builderPath}
|
chmod +x ${builderPath}
|
||||||
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.libraryFolderAbsolute} --artifactName lib-${guid} --cachePushTo ${linuxCacheFolder}/Library
|
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.libraryFolderAbsolute} --artifactName lib-${guid} --cachePushTo ${linuxCacheFolder}/Library
|
||||||
echo "game ci cloud runner push build to cache"
|
echo "game ci cloud runner push build to cache"
|
||||||
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute} --artifactName build-${guid} --cachePushTo ${`${linuxCacheFolder}/build`.replace(/\\/g, `/`)}
|
node ${builderPath} -m cache-push --cachePushFrom ${cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute} --artifactName build-${guid} --cachePushTo ${`${BuildAutomationWorkflow.ToLinuxFolder(linuxCacheFolder)}/build`}
|
||||||
${BuildAutomationWorkflow.GetCleanupCommand(cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute)}`;
|
${BuildAutomationWorkflow.GetCleanupCommand(cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute)}`;
|
||||||
}
|
}
|
||||||
static GetCleanupCommand(cleanupPath) {
|
static GetCleanupCommand(cleanupPath) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -63,6 +63,10 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ToLinuxFolder(folder: string) {
|
||||||
|
return folder.replace(/\\/g, `/`);
|
||||||
|
}
|
||||||
|
|
||||||
private static get BuildWorkflow() {
|
private static get BuildWorkflow() {
|
||||||
const setupHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customJobHooks).filter((x) =>
|
const setupHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customJobHooks).filter((x) =>
|
||||||
x.step.includes(`setup`),
|
x.step.includes(`setup`),
|
||||||
|
|
@ -70,14 +74,16 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
||||||
const buildHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customJobHooks).filter((x) =>
|
const buildHooks = CloudRunnerCustomHooks.getHooks(CloudRunner.buildParameters.customJobHooks).filter((x) =>
|
||||||
x.step.includes(`build`),
|
x.step.includes(`build`),
|
||||||
);
|
);
|
||||||
const builderPath = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist', `index.js`).replace(/\\/g, `/`);
|
const builderPath = BuildAutomationWorkflow.ToLinuxFolder(
|
||||||
|
path.join(CloudRunnerFolders.builderPathAbsolute, 'dist', `index.js`),
|
||||||
|
);
|
||||||
|
|
||||||
return `apt-get update > /dev/null
|
return `apt-get update > /dev/null
|
||||||
apt-get install -y tar tree npm git-lfs jq git > /dev/null
|
apt-get install -y tar tree npm git-lfs jq git > /dev/null
|
||||||
npm install -g n > /dev/null
|
npm install -g n > /dev/null
|
||||||
n stable > /dev/null
|
n stable > /dev/null
|
||||||
${setupHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
${setupHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||||
export GITHUB_WORKSPACE="${CloudRunnerFolders.repoPathAbsolute.replace(/\\/g, `/`)}"
|
export GITHUB_WORKSPACE="${BuildAutomationWorkflow.ToLinuxFolder(CloudRunnerFolders.repoPathAbsolute)}"
|
||||||
${BuildAutomationWorkflow.setupCommands(builderPath)}
|
${BuildAutomationWorkflow.setupCommands(builderPath)}
|
||||||
${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
|
||||||
${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
|
||||||
|
|
@ -88,10 +94,10 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
||||||
private static setupCommands(builderPath) {
|
private static setupCommands(builderPath) {
|
||||||
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||||
echo "game ci cloud runner clone"
|
echo "game ci cloud runner clone"
|
||||||
mkdir -p ${CloudRunnerFolders.builderPathAbsolute.replace(/\\/g, `/`)}
|
mkdir -p ${BuildAutomationWorkflow.ToLinuxFolder(CloudRunnerFolders.builderPathAbsolute)}
|
||||||
git clone -q -b ${CloudRunner.buildParameters.cloudRunnerBranch} ${
|
git clone -q -b ${CloudRunner.buildParameters.cloudRunnerBranch} ${
|
||||||
CloudRunnerFolders.unityBuilderRepoUrl
|
CloudRunnerFolders.unityBuilderRepoUrl
|
||||||
} "${CloudRunnerFolders.builderPathAbsolute.replace(/\\/g, `/`)}"
|
} "${BuildAutomationWorkflow.ToLinuxFolder(CloudRunnerFolders.builderPathAbsolute)}"
|
||||||
chmod +x ${builderPath}
|
chmod +x ${builderPath}
|
||||||
echo "game ci cloud runner bootstrap"
|
echo "game ci cloud runner bootstrap"
|
||||||
node ${builderPath} -m remote-cli`;
|
node ${builderPath} -m remote-cli`;
|
||||||
|
|
@ -99,16 +105,18 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
||||||
|
|
||||||
// ToDo: Replace with a very simple "node ${builderPath} -m build-cli" to run the scripts below without enlarging the request size
|
// ToDo: Replace with a very simple "node ${builderPath} -m build-cli" to run the scripts below without enlarging the request size
|
||||||
private static BuildCommands(builderPath, guid) {
|
private static BuildCommands(builderPath, guid) {
|
||||||
const linuxCacheFolder = CloudRunnerFolders.cacheFolderFull.replace(/\\/g, `/`);
|
const linuxCacheFolder = BuildAutomationWorkflow.ToLinuxFolder(CloudRunnerFolders.cacheFolderFull);
|
||||||
const distFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist');
|
const distFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist');
|
||||||
const ubuntuPlatformsFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
|
const ubuntuPlatformsFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
|
||||||
|
|
||||||
return `echo "game ci cloud runner init"
|
return `echo "game ci cloud runner init"
|
||||||
mkdir -p ${`${CloudRunnerFolders.projectBuildFolderAbsolute}/build`.replace(/\\/g, `/`)}
|
mkdir -p ${`${BuildAutomationWorkflow.ToLinuxFolder(CloudRunnerFolders.projectBuildFolderAbsolute)}/build`}
|
||||||
cd ${CloudRunnerFolders.projectPathAbsolute}
|
cd ${CloudRunnerFolders.projectPathAbsolute}
|
||||||
cp -r "${path.join(distFolder, 'default-build-script').replace(/\\/g, `/`)}" "/UnityBuilderAction"
|
cp -r "${BuildAutomationWorkflow.ToLinuxFolder(
|
||||||
cp -r "${path.join(ubuntuPlatformsFolder, 'entrypoint.sh').replace(/\\/g, `/`)}" "/entrypoint.sh"
|
path.join(distFolder, 'default-build-script'),
|
||||||
cp -r "${path.join(ubuntuPlatformsFolder, 'steps').replace(/\\/g, `/`)}" "/steps"
|
)}" "/UnityBuilderAction"
|
||||||
|
cp -r "${BuildAutomationWorkflow.ToLinuxFolder(path.join(ubuntuPlatformsFolder, 'entrypoint.sh'))}" "/entrypoint.sh"
|
||||||
|
cp -r "${BuildAutomationWorkflow.ToLinuxFolder(path.join(ubuntuPlatformsFolder, 'steps'))}" "/steps"
|
||||||
chmod -R +x "/entrypoint.sh"
|
chmod -R +x "/entrypoint.sh"
|
||||||
chmod -R +x "/steps"
|
chmod -R +x "/steps"
|
||||||
echo "game ci cloud runner start"
|
echo "game ci cloud runner start"
|
||||||
|
|
@ -121,7 +129,7 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
||||||
echo "game ci cloud runner push build to cache"
|
echo "game ci cloud runner push build to cache"
|
||||||
node ${builderPath} -m cache-push --cachePushFrom ${
|
node ${builderPath} -m cache-push --cachePushFrom ${
|
||||||
CloudRunnerFolders.projectBuildFolderAbsolute
|
CloudRunnerFolders.projectBuildFolderAbsolute
|
||||||
} --artifactName build-${guid} --cachePushTo ${`${linuxCacheFolder}/build`.replace(/\\/g, `/`)}
|
} --artifactName build-${guid} --cachePushTo ${`${BuildAutomationWorkflow.ToLinuxFolder(linuxCacheFolder)}/build`}
|
||||||
${BuildAutomationWorkflow.GetCleanupCommand(CloudRunnerFolders.projectPathAbsolute)}`;
|
${BuildAutomationWorkflow.GetCleanupCommand(CloudRunnerFolders.projectPathAbsolute)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue