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

@@ -269,6 +269,16 @@ inputs:
default: 'false'
required: false
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
cloneDepth:
default: '50'
required: false
description: '[CloudRunner] Specifies the depth of the git clone for the repository. Use 0 for full clone.'
cloudRunnerRepoName:
default: 'game-ci/unity-builder'
required: false
description:
'[CloudRunner] Specifies the repo for the unity builder. Useful if you forked the repo for testing, features, or
fixes.'
outputs:
volume:

21
dist/index.js generated vendored
View File

@@ -341,7 +341,9 @@ class BuildParameters {
branch: input_1.default.branch.replace('/head', '') || (await git_repo_1.GitRepoReader.GetBranch()),
cloudRunnerBranch: cloud_runner_options_1.default.cloudRunnerBranch.split('/').reverse()[0],
cloudRunnerDebug: cloud_runner_options_1.default.cloudRunnerDebug,
githubRepo: (input_1.default.githubRepo ?? (await git_repo_1.GitRepoReader.GetRemote())) || 'game-ci/unity-builder',
githubRepo: (input_1.default.githubRepo ?? (await git_repo_1.GitRepoReader.GetRemote())) || cloud_runner_options_1.default.cloudRunnerRepoName,
cloudRunnerRepoName: cloud_runner_options_1.default.cloudRunnerRepoName,
cloneDepth: Number.parseInt(cloud_runner_options_1.default.cloneDepth),
isCliMode: cli_1.Cli.isCliMode,
awsStackName: cloud_runner_options_1.default.awsStackName,
awsEndpoint: cloud_runner_options_1.default.awsEndpoint,
@@ -1166,7 +1168,7 @@ class CloudRunnerFolders {
return node_path_1.default.join(CloudRunnerFolders.cacheFolderForCacheKeyFull, `Library`);
}
static get unityBuilderRepoUrl() {
return `https://${cloud_runner_1.default.buildParameters.gitPrivateToken}@github.com/game-ci/unity-builder.git`;
return `https://${cloud_runner_1.default.buildParameters.gitPrivateToken}@github.com/${cloud_runner_1.default.buildParameters.cloudRunnerRepoName}.git`;
}
static get targetBuildRepoUrl() {
return `https://${cloud_runner_1.default.buildParameters.gitPrivateToken}@github.com/${cloud_runner_1.default.buildParameters.githubRepo}.git`;
@@ -1321,6 +1323,12 @@ class CloudRunnerOptions {
static get githubRepoName() {
return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo?.split(`/`)[1] || '';
}
static get cloudRunnerRepoName() {
return CloudRunnerOptions.getInput('cloudRunnerRepoName') || 'game-ci/unity-builder';
}
static get cloneDepth() {
return CloudRunnerOptions.getInput('cloneDepth') || '50';
}
static get finalHooks() {
return CloudRunnerOptions.getInput('finalHooks')?.split(',') || [];
}
@@ -1906,6 +1914,7 @@ class AWSCloudFormationTemplates {
}
static getSecretDefinitionTemplate(p1, p2) {
return `
Secrets:
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
`;
@@ -3157,8 +3166,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:
@@ -6846,7 +6854,8 @@ class RemoteClient {
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"`);
await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`);
try {
await cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${cloud_runner_folders_1.CloudRunnerFolders.targetBuildRepoUrl} ${node_path_1.default.basename(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}`);
const depthArg = cloud_runner_options_1.default.cloneDepth !== '0' ? `--depth ${cloud_runner_options_1.default.cloneDepth}` : '';
await cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${depthArg} ${cloud_runner_folders_1.CloudRunnerFolders.targetBuildRepoUrl} ${node_path_1.default.basename(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}`.trim());
}
catch (error) {
throw error;
@@ -9425,7 +9434,7 @@ class ImageTag {
this.targetPlatform = targetPlatform;
this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion, 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() {
return /^\d+\.\d+\.\d+[a-z]\d+$/;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

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 {

47
temp/pr-686-notes.md Normal file
View File

@@ -0,0 +1,47 @@
# PR #686 Integration Notes
## PR Details
- **Title:** Fixed AWS to work when no secrets specified
- **Author:** brian-golfplusvr
- **Base:** main
- **Head:** brian-golfplusvr:main
## Integration Status: COMPLETE
### Changes Applied
1. **AWS Secrets Fix**
- `task-definition-formation.ts`: Removed hardcoded `Secrets:` key from template
- `aws-cloud-formation-templates.ts`: Added `Secrets:` key to `getSecretDefinitionTemplate()` function
- **Result**: CloudFormation now works with OR without secrets
2. **Clone Depth Parameter**
- Added `cloneDepth` action input (default: 50, use 0 for full clone)
- Added getter in `cloud-runner-options.ts`
- Added property in `build-parameters.ts`
- Updated `remote-client/index.ts` to use `--depth` parameter
3. **Cloud Runner Repo Name**
- Added `cloudRunnerRepoName` action input (default: game-ci/unity-builder)
- Added getter in `cloud-runner-options.ts`
- Added property in `build-parameters.ts`
- Updated `cloud-runner-folders.ts` to use dynamic repo name
4. **Image Rolling Version Type**
- Changed `imageRollingVersion` from `number` to `string` in `image-tag.ts`
- Allows dot versions (e.g., "3.1.0")
### Files Modified
- `action.yml` - Added cloneDepth, cloudRunnerRepoName inputs
- `src/model/build-parameters.ts` - Added properties
- `src/model/cloud-runner/options/cloud-runner-options.ts` - Added getters
- `src/model/cloud-runner/options/cloud-runner-folders.ts` - Dynamic repo URL
- `src/model/cloud-runner/remote-client/index.ts` - Clone depth parameter
- `src/model/cloud-runner/providers/aws/cloud-formations/task-definition-formation.ts` - Secrets fix
- `src/model/cloud-runner/providers/aws/aws-cloud-formation-templates.ts` - Secrets fix
- `src/model/image-tag.ts` - imageRollingVersion type change
### Not Applicable (Already in our branch)
- AWS SDK v3 migration (we already have it)
- Additional debug logging (we have better logging)
- Stack wait time config (we already have CLOUD_RUNNER_AWS_STACK_WAIT_TIME)