feat: create .game-ci folder in user folder.
parent
bee44a358c
commit
52f57c5e18
|
|
@ -1,13 +1,13 @@
|
||||||
# Activate Unity
|
|
||||||
& "c:\steps\activate.ps1"
|
|
||||||
|
|
||||||
# Import any necessary registry keys, ie: location of windows 10 sdk
|
# Import any necessary registry keys, ie: location of windows 10 sdk
|
||||||
# No guarantee that there will be any necessary registry keys, ie: tvOS
|
# No guarantee that there will be any necessary registry keys, ie: tvOS
|
||||||
Get-ChildItem -Path c:\regkeys -File | Foreach {reg import $_.fullname}
|
Get-ChildItem -Path c:\registry-keys -File | Foreach {reg import $_.fullname}
|
||||||
|
|
||||||
# Register the Visual Studio installation so Unity can find it
|
# Register the Visual Studio installation so Unity can find it
|
||||||
regsvr32 C:\ProgramData\Microsoft\VisualStudio\Setup\x64\Microsoft.VisualStudio.Setup.Configuration.Native.dll
|
regsvr32 C:\ProgramData\Microsoft\VisualStudio\Setup\x64\Microsoft.VisualStudio.Setup.Configuration.Native.dll
|
||||||
|
|
||||||
|
# Activate Unity
|
||||||
|
& "c:\steps\activate.ps1"
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
& "c:\steps\build.ps1"
|
& "c:\steps\build.ps1"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,4 @@ export class Options {
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
registerCommand(command: CommandInterface) {
|
|
||||||
this.command = command;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import * as assert from 'https://deno.land/std@0.144.0/testing/asserts.ts';
|
||||||
import * as aws from 'https://deno.land/x/aws_api/client/mod.ts';
|
import * as aws from 'https://deno.land/x/aws_api/client/mod.ts';
|
||||||
import * as base64 from 'https://deno.land/std@0.145.0/encoding/base64.ts';
|
import * as base64 from 'https://deno.land/std@0.145.0/encoding/base64.ts';
|
||||||
import * as compress from 'https://deno.land/x/compress@v0.3.3/mod.ts';
|
import * as compress from 'https://deno.land/x/compress@v0.3.3/mod.ts';
|
||||||
import * as fs from 'https://deno.land/std@0.142.0/node/fs/promises.ts';
|
import * as fs from 'https://deno.land/std@0.152.0/node/fs/promises.ts';
|
||||||
import * as fsSync from 'https://deno.land/std@0.142.0/fs/mod.ts';
|
import * as fsSync from 'https://deno.land/std@0.152.0/fs/mod.ts';
|
||||||
import * as k8s from 'https://deno.land/x/kubernetes_client/mod.ts';
|
import * as k8s from 'https://deno.land/x/kubernetes_client/mod.ts';
|
||||||
import * as k8sTypes from 'https://deno.land/x/kubernetes_apis/builtin/core@v1/mod.ts';
|
import * as k8sTypes from 'https://deno.land/x/kubernetes_apis/builtin/core@v1/mod.ts';
|
||||||
import * as nanoid from 'https://deno.land/x/nanoid@v3.0.0/mod.ts';
|
import * as nanoid from 'https://deno.land/x/nanoid@v3.0.0/mod.ts';
|
||||||
|
|
|
||||||
|
|
@ -20,16 +20,18 @@ export class GameCI {
|
||||||
const { commandName, subCommands, args, verbosity } = new ArgumentsParser().parse(this.args);
|
const { commandName, subCommands, args, verbosity } = new ArgumentsParser().parse(this.args);
|
||||||
await configureLogger(verbosity);
|
await configureLogger(verbosity);
|
||||||
|
|
||||||
// Determine the command and its options
|
// Determine which command to run
|
||||||
const { engine, engineVersion } = await new EngineDetector(subCommands, args).detect();
|
const { engine, engineVersion } = await new EngineDetector(subCommands, args).detect();
|
||||||
const command = new CommandFactory().selectEngine(engine, engineVersion).createCommand(commandName, subCommands);
|
const command = new CommandFactory().selectEngine(engine, engineVersion).createCommand(commandName, subCommands);
|
||||||
const options = await new Options(command, this.env).registerCommand(command).generateParameters(args);
|
|
||||||
|
// Provide the command with options
|
||||||
|
const options = await new Options(command, this.env).generateParameters(args);
|
||||||
await command.configure(options).validate();
|
await command.configure(options).validate();
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
if (log.isVerbose) log.info('Executing', command.name);
|
if (log.isVerbose) log.info('Executing', command.name);
|
||||||
const success = await command.execute();
|
const success = await command.execute();
|
||||||
if (!success) log.warning(`Command ${command.name} failed.`);
|
if (!success) log.info(`Command ${command.name} failed.`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
Deno.exit(1);
|
Deno.exit(1);
|
||||||
|
|
|
||||||
|
|
@ -2,32 +2,20 @@ import { fsSync as fs, exec } from '../../../dependencies.ts';
|
||||||
import { Parameters } from '../../../model/index.ts';
|
import { Parameters } from '../../../model/index.ts';
|
||||||
|
|
||||||
class SetupWindows {
|
class SetupWindows {
|
||||||
public static async setup(buildParameters: Parameters) {
|
public static async setup(parameters: Parameters) {
|
||||||
const { targetPlatform } = buildParameters;
|
await this.generateWinSdkRegistryKey(parameters);
|
||||||
|
|
||||||
await SetupWindows.setupWindowsRun(targetPlatform);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async setupWindowsRun(targetPlatform, silent = false) {
|
private static async generateWinSdkRegistryKey(parameters) {
|
||||||
if (!fs.existsSync('c:/regkeys')) {
|
const { targetPlatform, cliStoragePath } = parameters;
|
||||||
fs.mkdirSync('c:/regkeys');
|
|
||||||
}
|
|
||||||
|
|
||||||
// These all need the Windows 10 SDK
|
if (!['StandaloneWindows', 'StandaloneWindows64', 'WSAPlayer'].includes(targetPlatform)) return;
|
||||||
switch (targetPlatform) {
|
|
||||||
case 'StandaloneWindows':
|
|
||||||
case 'StandaloneWindows64':
|
|
||||||
case 'WSAPlayer':
|
|
||||||
await this.generateWinSDKRegKeys(silent);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static async generateWinSDKRegKeys(silent = false) {
|
const registryKeysPath = `${cliStoragePath}/registry-keys`;
|
||||||
// Export registry keys that point to the Windows 10 SDK
|
const copyWinSdkRegistryKeyCommand = `reg export "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" ${registryKeysPath}/winsdk.reg /y`;
|
||||||
const exportWinSDKRegKeysCommand =
|
|
||||||
'reg export "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" c:/regkeys/winsdk.reg /y';
|
await fs.ensureDir(registryKeysPath);
|
||||||
await exec(exportWinSDKRegKeysCommand, undefined, { silent });
|
await exec(copyWinSdkRegistryKeyCommand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class Docker {
|
||||||
}
|
}
|
||||||
|
|
||||||
static getWindowsCommand(image: any, parameters: any): string {
|
static getWindowsCommand(image: any, parameters: any): string {
|
||||||
const { workspace, actionFolder, unitySerial, gitPrivateToken } = parameters;
|
const { workspace, actionFolder, unitySerial, gitPrivateToken, cliStoragePath } = parameters;
|
||||||
|
|
||||||
return `docker run \
|
return `docker run \
|
||||||
--workdir /github/workspace \
|
--workdir /github/workspace \
|
||||||
|
|
@ -53,7 +53,7 @@ class Docker {
|
||||||
--env GITHUB_WORKSPACE=c:/github/workspace \
|
--env GITHUB_WORKSPACE=c:/github/workspace \
|
||||||
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
||||||
--volume "${workspace}":"c:/github/workspace" \
|
--volume "${workspace}":"c:/github/workspace" \
|
||||||
--volume "c:/regkeys":"c:/regkeys" \
|
--volume "${cliStoragePath}/registry-keys":"c:/registry-keys" \
|
||||||
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
||||||
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
|
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
|
||||||
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
|
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
import { nanoid } from '../dependencies.ts';
|
import { default as getHomeDir } from 'https://deno.land/x/dir@1.5.1/home_dir/mod.ts';
|
||||||
import AndroidVersioning from './android-versioning.ts';
|
import AndroidVersioning from './android-versioning.ts';
|
||||||
import CloudRunnerConstants from './cloud-runner/services/cloud-runner-constants.ts';
|
|
||||||
import CloudRunnerBuildGuid from './cloud-runner/services/cloud-runner-guid.ts';
|
|
||||||
import Input from './input.ts';
|
import Input from './input.ts';
|
||||||
import Platform from './platform.ts';
|
import Platform from './platform.ts';
|
||||||
import UnityVersioning from './unity-versioning.ts';
|
import UnityVersioning from './unity-versioning.ts';
|
||||||
import Versioning from './versioning.ts';
|
import Versioning from './versioning.ts';
|
||||||
import { GitRepoReader } from './input-readers/git-repo.ts';
|
import { GitRepoReader } from './input-readers/git-repo.ts';
|
||||||
import { GithubCliReader } from './input-readers/github-cli.ts';
|
|
||||||
import { Cli } from './cli/cli.ts';
|
|
||||||
import { CommandInterface } from '../commands/command/command-interface.ts';
|
import { CommandInterface } from '../commands/command/command-interface.ts';
|
||||||
import { Environment } from '../core/env/environment.ts';
|
import { Environment } from '../core/env/environment.ts';
|
||||||
|
|
||||||
|
|
@ -77,6 +73,8 @@ class Parameters {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async parse(): Promise<Parameters> {
|
public async parse(): Promise<Parameters> {
|
||||||
|
const cliStoragePath = `${getHomeDir()}/.game-ci`;
|
||||||
|
|
||||||
const buildFile = Parameters.parseBuildFile(
|
const buildFile = Parameters.parseBuildFile(
|
||||||
this.input.buildName,
|
this.input.buildName,
|
||||||
this.input.targetPlatform,
|
this.input.targetPlatform,
|
||||||
|
|
@ -131,6 +129,7 @@ class Parameters {
|
||||||
log.info(`targetPlatform: "${targetPlatform}"`);
|
log.info(`targetPlatform: "${targetPlatform}"`);
|
||||||
|
|
||||||
const parameters = {
|
const parameters = {
|
||||||
|
cliStoragePath,
|
||||||
editorVersion,
|
editorVersion,
|
||||||
customImage: this.input.customImage,
|
customImage: this.input.customImage,
|
||||||
unityEmail,
|
unityEmail,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue