Merge with main
						commit
						bdf28b99ee
					
				
							
								
								
									
										114
									
								
								action.yml
								
								
								
								
							
							
						
						
									
										114
									
								
								action.yml
								
								
								
								
							|  | @ -2,6 +2,10 @@ name: 'Unity - Builder' | ||||||
| author: Webber Takken <webber@takken.io> | author: Webber Takken <webber@takken.io> | ||||||
| description: 'Build Unity projects for different platforms.' | description: 'Build Unity projects for different platforms.' | ||||||
| inputs: | inputs: | ||||||
|  |   targetPlatform: | ||||||
|  |     required: true | ||||||
|  |     default: '' | ||||||
|  |     description: 'Platform that the build should target.' | ||||||
|   unityVersion: |   unityVersion: | ||||||
|     required: false |     required: false | ||||||
|     default: 'auto' |     default: 'auto' | ||||||
|  | @ -10,10 +14,6 @@ inputs: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|     description: 'Specific docker image that should be used for building the project' |     description: 'Specific docker image that should be used for building the project' | ||||||
|   targetPlatform: |  | ||||||
|     required: false |  | ||||||
|     default: '' |  | ||||||
|     description: 'Platform that the build should target.' |  | ||||||
|   projectPath: |   projectPath: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|  | @ -22,18 +22,6 @@ inputs: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|     description: 'Name of the build.' |     description: 'Name of the build.' | ||||||
|   postBuildSteps: |  | ||||||
|     required: false |  | ||||||
|     default: '' |  | ||||||
|     description: 'run a post build job in yaml format with the keys image, secrets (name, value object array), command string' |  | ||||||
|   preBuildSteps: |  | ||||||
|     required: false |  | ||||||
|     default: '' |  | ||||||
|     description: 'Run a pre build job after the repository setup but before the build job (in yaml format with the keys image, secrets (name, value object array), command line string)' |  | ||||||
|   customJob: |  | ||||||
|     required: false |  | ||||||
|     default: '' |  | ||||||
|     description: 'Run a custom job instead of the standard build automation for cloud runner (in yaml format with the keys image, secrets (name, value object array), command line string)' |  | ||||||
|   buildsPath: |   buildsPath: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|  | @ -42,38 +30,10 @@ inputs: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|     description: 'Path to a Namespace.Class.StaticMethod to run to perform the build.' |     description: 'Path to a Namespace.Class.StaticMethod to run to perform the build.' | ||||||
|   cloudRunnerCluster: |   customParameters: | ||||||
|     default: 'local' |  | ||||||
|     required: false |     required: false | ||||||
|     description: 'Either local, k8s or aws can be used to run builds on a remote cluster. Additional parameters must be configured.' |  | ||||||
|   awsStackName: |  | ||||||
|     default: 'game-ci' |  | ||||||
|     required: false |  | ||||||
|     description: 'The Cloud Formation stack name that must be setup before using this option.' |  | ||||||
|   kubeConfig: |  | ||||||
|     default: '' |     default: '' | ||||||
|     required: false |     description: 'Custom parameters to configure the build.' | ||||||
|     description: 'Supply a base64 encoded kubernetes config to run builds on kubernetes and stream logs until completion.' |  | ||||||
|   kubeVolume: |  | ||||||
|     default: '' |  | ||||||
|     required: false |  | ||||||
|     description: 'Supply a Persistent Volume Claim name to use for the Unity build.' |  | ||||||
|   cloudRunnerMemory: |  | ||||||
|     default: '750M' |  | ||||||
|     required: false |  | ||||||
|     description: 'Amount of memory to assign the remote build container' |  | ||||||
|   cloudRunnerCpu: |  | ||||||
|     default: '1.0' |  | ||||||
|     required: false |  | ||||||
|     description: 'Amount of CPU time to assign the remote build container' |  | ||||||
|   kubeVolumeSize: |  | ||||||
|     default: '5Gi' |  | ||||||
|     required: false |  | ||||||
|     description: 'Amount of disc space to assign the Kubernetes Persistent Volume' |  | ||||||
|   githubToken: |  | ||||||
|     default: '' |  | ||||||
|     required: false |  | ||||||
|     description: 'GitHub token for cloning, only needed when kubeconfig is used.' |  | ||||||
|   versioning: |   versioning: | ||||||
|     required: false |     required: false | ||||||
|     default: 'Semantic' |     default: 'Semantic' | ||||||
|  | @ -114,14 +74,6 @@ inputs: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|     description: 'The android target API level.' |     description: 'The android target API level.' | ||||||
|   customParameters: |  | ||||||
|     required: false |  | ||||||
|     default: '' |  | ||||||
|     description: > |  | ||||||
|       Custom parameters to configure the build. |  | ||||||
| 
 |  | ||||||
|       Parameters must start with a hyphen (-) and may be followed by a value (without hyphen). |  | ||||||
|       Parameters without a value will be considered booleans (with a value of true). |  | ||||||
|   sshAgent: |   sshAgent: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|  | @ -129,8 +81,7 @@ inputs: | ||||||
|   gitPrivateToken: |   gitPrivateToken: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|     description: > |     description: 'Github private token to pull from github' | ||||||
|       Github private token to pull from github |  | ||||||
|   chownFilesTo: |   chownFilesTo: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|  | @ -138,12 +89,51 @@ inputs: | ||||||
|   allowDirtyBuild: |   allowDirtyBuild: | ||||||
|     required: false |     required: false | ||||||
|     default: '' |     default: '' | ||||||
|     description: > |     description: 'Allows the branch of the build to be dirty, and still generate the build.' | ||||||
|       Allows the branch of the build to be dirty, and still generate the build. |   postBuildSteps: | ||||||
| 
 |     required: false | ||||||
|       Note that it is generally bad practice to modify your branch |     default: '' | ||||||
|       in a CI Pipeline. However there are exceptions where this might |     description: 'run a post build job in yaml format with the keys image, secrets (name, value object array), command string' | ||||||
|       be needed. (use with care). |   preBuildSteps: | ||||||
|  |     required: false | ||||||
|  |     default: '' | ||||||
|  |     description: 'Run a pre build job after the repository setup but before the build job (in yaml format with the keys image, secrets (name, value object array), command line string)' | ||||||
|  |   customJob: | ||||||
|  |     required: false | ||||||
|  |     default: '' | ||||||
|  |     description: 'Run a custom job instead of the standard build automation for cloud runner (in yaml format with the keys image, secrets (name, value object array), command line string)' | ||||||
|  |   awsBaseStackName: | ||||||
|  |     default: 'game-ci' | ||||||
|  |     required: false | ||||||
|  |     description: 'The Cloud Formation stack name that must be setup before using this option.' | ||||||
|  |   cloudRunnerCluster: | ||||||
|  |     default: 'local' | ||||||
|  |     required: false | ||||||
|  |     description: 'Either local, k8s or aws can be used to run builds on a remote cluster. Additional parameters must be configured.' | ||||||
|  |   cloudRunnerCpu: | ||||||
|  |     default: '1.0' | ||||||
|  |     required: false | ||||||
|  |     description: 'Amount of CPU time to assign the remote build container' | ||||||
|  |   cloudRunnerMemory: | ||||||
|  |     default: '750M' | ||||||
|  |     required: false | ||||||
|  |     description: 'Amount of memory to assign the remote build container' | ||||||
|  |   githubToken: | ||||||
|  |     default: '' | ||||||
|  |     required: false | ||||||
|  |     description: 'GitHub token for cloning, only needed when kubeconfig is used.' | ||||||
|  |   kubeConfig: | ||||||
|  |     default: '' | ||||||
|  |     required: false | ||||||
|  |     description: 'Supply a base64 encoded kubernetes config to run builds on kubernetes and stream logs until completion.' | ||||||
|  |   kubeVolume: | ||||||
|  |     default: '' | ||||||
|  |     required: false | ||||||
|  |     description: 'Supply a Persistent Volume Claim name to use for the Unity build.' | ||||||
|  |   kubeVolumeSize: | ||||||
|  |     default: '5Gi' | ||||||
|  |     required: false | ||||||
|  |     description: 'Amount of disc space to assign the Kubernetes Persistent Volume' | ||||||
| outputs: | outputs: | ||||||
|   volume: |   volume: | ||||||
|     description: 'The Persistent Volume (PV) where the build artifacts have been stored by Kubernetes' |     description: 'The Persistent Volume (PV) where the build artifacts have been stored by Kubernetes' | ||||||
|  |  | ||||||
|  | @ -3880,15 +3880,15 @@ class Input { | ||||||
|     static get runNumber() { |     static get runNumber() { | ||||||
|         return Input.getInput('GITHUB_RUN_NUMBER') || '0'; |         return Input.getInput('GITHUB_RUN_NUMBER') || '0'; | ||||||
|     } |     } | ||||||
|  |     static get targetPlatform() { | ||||||
|  |         return Input.getInput('targetPlatform') || platform_1.default.default; | ||||||
|  |     } | ||||||
|     static get unityVersion() { |     static get unityVersion() { | ||||||
|         return Input.getInput('unityVersion') || 'auto'; |         return Input.getInput('unityVersion') || 'auto'; | ||||||
|     } |     } | ||||||
|     static get customImage() { |     static get customImage() { | ||||||
|         return Input.getInput('customImage'); |         return Input.getInput('customImage'); | ||||||
|     } |     } | ||||||
|     static get targetPlatform() { |  | ||||||
|         return Input.getInput('targetPlatform') || platform_1.default.default; |  | ||||||
|     } |  | ||||||
|     static get projectPath() { |     static get projectPath() { | ||||||
|         const input = Input.getInput('projectPath'); |         const input = Input.getInput('projectPath'); | ||||||
|         const rawProjectPath = input |         const rawProjectPath = input | ||||||
|  | @ -3908,6 +3908,9 @@ class Input { | ||||||
|     static get buildMethod() { |     static get buildMethod() { | ||||||
|         return Input.getInput('buildMethod') || ''; // processed in docker file
 |         return Input.getInput('buildMethod') || ''; // processed in docker file
 | ||||||
|     } |     } | ||||||
|  |     static get customParameters() { | ||||||
|  |         return Input.getInput('customParameters') || ''; | ||||||
|  |     } | ||||||
|     static get versioningStrategy() { |     static get versioningStrategy() { | ||||||
|         return Input.getInput('versioning') || 'Semantic'; |         return Input.getInput('versioning') || 'Semantic'; | ||||||
|     } |     } | ||||||
|  | @ -3939,21 +3942,9 @@ class Input { | ||||||
|     static get androidTargetSdkVersion() { |     static get androidTargetSdkVersion() { | ||||||
|         return core.getInput('androidTargetSdkVersion') || ''; |         return core.getInput('androidTargetSdkVersion') || ''; | ||||||
|     } |     } | ||||||
|     static get allowDirtyBuild() { |  | ||||||
|         const input = Input.getInput('allowDirtyBuild') || false; |  | ||||||
|         return input === 'true'; |  | ||||||
|     } |  | ||||||
|     static get customParameters() { |  | ||||||
|         return Input.getInput('customParameters') || ''; |  | ||||||
|     } |  | ||||||
|     static get sshAgent() { |     static get sshAgent() { | ||||||
|         return Input.getInput('sshAgent') || ''; |         return Input.getInput('sshAgent') || ''; | ||||||
|     } |     } | ||||||
|     static githubToken() { |  | ||||||
|         return __awaiter(this, void 0, void 0, function* () { |  | ||||||
|             return Input.getInput('githubToken') || (yield github_cli_1.GithubCliReader.GetGitHubAuthToken()) || ''; |  | ||||||
|         }); |  | ||||||
|     } |  | ||||||
|     static gitPrivateToken() { |     static gitPrivateToken() { | ||||||
|         return __awaiter(this, void 0, void 0, function* () { |         return __awaiter(this, void 0, void 0, function* () { | ||||||
|             return core.getInput('gitPrivateToken') || (yield Input.githubToken()); |             return core.getInput('gitPrivateToken') || (yield Input.githubToken()); | ||||||
|  | @ -3962,6 +3953,10 @@ class Input { | ||||||
|     static get chownFilesTo() { |     static get chownFilesTo() { | ||||||
|         return Input.getInput('chownFilesTo') || ''; |         return Input.getInput('chownFilesTo') || ''; | ||||||
|     } |     } | ||||||
|  |     static get allowDirtyBuild() { | ||||||
|  |         const input = Input.getInput('allowDirtyBuild') || false; | ||||||
|  |         return input === 'true'; | ||||||
|  |     } | ||||||
|     static get postBuildSteps() { |     static get postBuildSteps() { | ||||||
|         return Input.getInput('postBuildSteps') || ''; |         return Input.getInput('postBuildSteps') || ''; | ||||||
|     } |     } | ||||||
|  | @ -3971,27 +3966,32 @@ class Input { | ||||||
|     static get customJob() { |     static get customJob() { | ||||||
|         return Input.getInput('customJob') || ''; |         return Input.getInput('customJob') || ''; | ||||||
|     } |     } | ||||||
|     static get cloudRunnerCluster() { |  | ||||||
|         return Input.getInput('cloudRunnerCluster') || ''; |  | ||||||
|     } |  | ||||||
|     static get awsBaseStackName() { |     static get awsBaseStackName() { | ||||||
|         return Input.getInput('awsBaseStackName') || 'game-ci'; |         return Input.getInput('awsBaseStackName') || 'game-ci'; | ||||||
|     } |     } | ||||||
|     static get kubeConfig() { |     static get cloudRunnerCluster() { | ||||||
|         return Input.getInput('kubeConfig') || ''; |         return Input.getInput('cloudRunnerCluster') || 'local'; | ||||||
|     } |  | ||||||
|     static get cloudRunnerMemory() { |  | ||||||
|         return Input.getInput('cloudRunnerMemory') || '750M'; |  | ||||||
|     } |     } | ||||||
|     static get cloudRunnerCpu() { |     static get cloudRunnerCpu() { | ||||||
|         return Input.getInput('cloudRunnerCpu') || '1.0'; |         return Input.getInput('cloudRunnerCpu') || '1.0'; | ||||||
|     } |     } | ||||||
|     static get kubeVolumeSize() { |     static get cloudRunnerMemory() { | ||||||
|         return Input.getInput('kubeVolumeSize') || '5Gi'; |         return Input.getInput('cloudRunnerMemory') || '750M'; | ||||||
|  |     } | ||||||
|  |     static githubToken() { | ||||||
|  |         return __awaiter(this, void 0, void 0, function* () { | ||||||
|  |             return Input.getInput('githubToken') || (yield github_cli_1.GithubCliReader.GetGitHubAuthToken()) || ''; | ||||||
|  |         }); | ||||||
|  |     } | ||||||
|  |     static get kubeConfig() { | ||||||
|  |         return Input.getInput('kubeConfig') || ''; | ||||||
|     } |     } | ||||||
|     static get kubeVolume() { |     static get kubeVolume() { | ||||||
|         return Input.getInput('kubeVolume') || ''; |         return Input.getInput('kubeVolume') || ''; | ||||||
|     } |     } | ||||||
|  |     static get kubeVolumeSize() { | ||||||
|  |         return Input.getInput('kubeVolumeSize') || '5Gi'; | ||||||
|  |     } | ||||||
|     static ToEnvVarFormat(input) { |     static ToEnvVarFormat(input) { | ||||||
|         return input |         return input | ||||||
|             .replace(/([A-Z])/g, ' $1') |             .replace(/([A-Z])/g, ' $1') | ||||||
|  |  | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -69,6 +69,10 @@ class Input { | ||||||
|     return Input.getInput('GITHUB_RUN_NUMBER') || '0'; |     return Input.getInput('GITHUB_RUN_NUMBER') || '0'; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   static get targetPlatform() { | ||||||
|  |     return Input.getInput('targetPlatform') || Platform.default; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   static get unityVersion() { |   static get unityVersion() { | ||||||
|     return Input.getInput('unityVersion') || 'auto'; |     return Input.getInput('unityVersion') || 'auto'; | ||||||
|   } |   } | ||||||
|  | @ -77,10 +81,6 @@ class Input { | ||||||
|     return Input.getInput('customImage'); |     return Input.getInput('customImage'); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static get targetPlatform() { |  | ||||||
|     return Input.getInput('targetPlatform') || Platform.default; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   static get projectPath() { |   static get projectPath() { | ||||||
|     const input = Input.getInput('projectPath'); |     const input = Input.getInput('projectPath'); | ||||||
|     const rawProjectPath = input |     const rawProjectPath = input | ||||||
|  | @ -104,6 +104,10 @@ class Input { | ||||||
|     return Input.getInput('buildMethod') || ''; // processed in docker file
 |     return Input.getInput('buildMethod') || ''; // processed in docker file
 | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   static get customParameters() { | ||||||
|  |     return Input.getInput('customParameters') || ''; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   static get versioningStrategy() { |   static get versioningStrategy() { | ||||||
|     return Input.getInput('versioning') || 'Semantic'; |     return Input.getInput('versioning') || 'Semantic'; | ||||||
|   } |   } | ||||||
|  | @ -146,24 +150,10 @@ class Input { | ||||||
|     return core.getInput('androidTargetSdkVersion') || ''; |     return core.getInput('androidTargetSdkVersion') || ''; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static get allowDirtyBuild() { |  | ||||||
|     const input = Input.getInput('allowDirtyBuild') || false; |  | ||||||
| 
 |  | ||||||
|     return input === 'true'; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   static get customParameters() { |  | ||||||
|     return Input.getInput('customParameters') || ''; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   static get sshAgent() { |   static get sshAgent() { | ||||||
|     return Input.getInput('sshAgent') || ''; |     return Input.getInput('sshAgent') || ''; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static async githubToken() { |  | ||||||
|     return Input.getInput('githubToken') || (await GithubCliReader.GetGitHubAuthToken()) || ''; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   static async gitPrivateToken() { |   static async gitPrivateToken() { | ||||||
|     return core.getInput('gitPrivateToken') || (await Input.githubToken()); |     return core.getInput('gitPrivateToken') || (await Input.githubToken()); | ||||||
|   } |   } | ||||||
|  | @ -172,6 +162,12 @@ class Input { | ||||||
|     return Input.getInput('chownFilesTo') || ''; |     return Input.getInput('chownFilesTo') || ''; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   static get allowDirtyBuild() { | ||||||
|  |     const input = Input.getInput('allowDirtyBuild') || false; | ||||||
|  | 
 | ||||||
|  |     return input === 'true'; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   static get postBuildSteps() { |   static get postBuildSteps() { | ||||||
|     return Input.getInput('postBuildSteps') || ''; |     return Input.getInput('postBuildSteps') || ''; | ||||||
|   } |   } | ||||||
|  | @ -184,34 +180,38 @@ class Input { | ||||||
|     return Input.getInput('customJob') || ''; |     return Input.getInput('customJob') || ''; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static get cloudRunnerCluster() { |  | ||||||
|     return Input.getInput('cloudRunnerCluster') || ''; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   static get awsBaseStackName() { |   static get awsBaseStackName() { | ||||||
|     return Input.getInput('awsBaseStackName') || 'game-ci'; |     return Input.getInput('awsBaseStackName') || 'game-ci'; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static get kubeConfig() { |   static get cloudRunnerCluster() { | ||||||
|     return Input.getInput('kubeConfig') || ''; |     return Input.getInput('cloudRunnerCluster') || 'local'; | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   static get cloudRunnerMemory() { |  | ||||||
|     return Input.getInput('cloudRunnerMemory') || '750M'; |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static get cloudRunnerCpu() { |   static get cloudRunnerCpu() { | ||||||
|     return Input.getInput('cloudRunnerCpu') || '1.0'; |     return Input.getInput('cloudRunnerCpu') || '1.0'; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static get kubeVolumeSize() { |   static get cloudRunnerMemory() { | ||||||
|     return Input.getInput('kubeVolumeSize') || '5Gi'; |     return Input.getInput('cloudRunnerMemory') || '750M'; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   static async githubToken() { | ||||||
|  |     return Input.getInput('githubToken') || (await GithubCliReader.GetGitHubAuthToken()) || ''; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   static get kubeConfig() { | ||||||
|  |     return Input.getInput('kubeConfig') || ''; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static get kubeVolume() { |   static get kubeVolume() { | ||||||
|     return Input.getInput('kubeVolume') || ''; |     return Input.getInput('kubeVolume') || ''; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   static get kubeVolumeSize() { | ||||||
|  |     return Input.getInput('kubeVolumeSize') || '5Gi'; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   public static ToEnvVarFormat(input: string) { |   public static ToEnvVarFormat(input: string) { | ||||||
|     return input |     return input | ||||||
|       .replace(/([A-Z])/g, ' $1') |       .replace(/([A-Z])/g, ' $1') | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue