integrate PR #686

This commit is contained in:
frostebite
2026-01-28 07:19:21 +00:00
parent 4393f04d38
commit 08eabcf899
11 changed files with 93 additions and 14 deletions

View File

@@ -84,6 +84,8 @@ class BuildParameters {
public runNumber!: string;
public branch!: string;
public githubRepo!: string;
public cloudRunnerRepoName!: string;
public cloneDepth!: number;
public gitSha!: string;
public logId!: string;
public buildGuid!: string;
@@ -206,7 +208,9 @@ class BuildParameters {
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),
cloudRunnerBranch: CloudRunnerOptions.cloudRunnerBranch.split('/').reverse()[0],
cloudRunnerDebug: CloudRunnerOptions.cloudRunnerDebug,
githubRepo: (Input.githubRepo ?? (await GitRepoReader.GetRemote())) || 'game-ci/unity-builder',
githubRepo: (Input.githubRepo ?? (await GitRepoReader.GetRemote())) || CloudRunnerOptions.cloudRunnerRepoName,
cloudRunnerRepoName: CloudRunnerOptions.cloudRunnerRepoName,
cloneDepth: Number.parseInt(CloudRunnerOptions.cloneDepth),
isCliMode: Cli.isCliMode,
awsStackName: CloudRunnerOptions.awsStackName,
awsEndpoint: CloudRunnerOptions.awsEndpoint,

View File

@@ -73,7 +73,7 @@ export class CloudRunnerFolders {
}
public static get unityBuilderRepoUrl(): string {
return `https://${CloudRunner.buildParameters.gitPrivateToken}@github.com/game-ci/unity-builder.git`;
return `https://${CloudRunner.buildParameters.gitPrivateToken}@github.com/${CloudRunner.buildParameters.cloudRunnerRepoName}.git`;
}
public static get targetBuildRepoUrl(): string {

View File

@@ -74,6 +74,14 @@ class CloudRunnerOptions {
return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo?.split(`/`)[1] || '';
}
static get cloudRunnerRepoName(): string {
return CloudRunnerOptions.getInput('cloudRunnerRepoName') || 'game-ci/unity-builder';
}
static get cloneDepth(): string {
return CloudRunnerOptions.getInput('cloneDepth') || '50';
}
static get finalHooks(): string[] {
return CloudRunnerOptions.getInput('finalHooks')?.split(',') || [];
}

View File

@@ -21,6 +21,7 @@ export class AWSCloudFormationTemplates {
public static getSecretDefinitionTemplate(p1: string, p2: string) {
return `
Secrets:
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
`;

View File

@@ -127,8 +127,7 @@ Resources:
- SourceVolume: efs-data
ContainerPath: !Ref EFSMountDirectory
ReadOnly: false
Secrets:
# template secrets p3 - container def
# template secrets p3 - container def
LogConfiguration:
LogDriver: awslogs
Options:

View File

@@ -306,8 +306,9 @@ export class RemoteClient {
await CloudRunnerSystem.Run(`git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"`);
await CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`);
try {
const depthArg = CloudRunnerOptions.cloneDepth !== '0' ? `--depth ${CloudRunnerOptions.cloneDepth}` : '';
await CloudRunnerSystem.Run(
`git clone ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename(CloudRunnerFolders.repoPathAbsolute)}`,
`git clone ${depthArg} ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename(CloudRunnerFolders.repoPathAbsolute)}`.trim(),
);
} catch (error: any) {
throw error;

View File

@@ -6,7 +6,7 @@ class ImageTag {
public targetPlatform: string;
public builderPlatform: string;
public customImage: string;
public imageRollingVersion: number;
public imageRollingVersion: string;
public imagePlatformPrefix: string;
constructor(imageProperties: { [key: string]: string }) {
@@ -38,7 +38,7 @@ class ImageTag {
providerStrategy,
);
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform);
this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version.
this.imageRollingVersion = containerRegistryImageVersion; // Will automatically roll to the latest non-breaking version.
}
static get versionPattern(): RegExp {