mirror of
				https://github.com/docker/setup-buildx-action.git
				synced 2025-10-31 01:20:09 +08:00 
			
		
		
		
	WIP - always download precompiled binaries first
before this change, we would try to determine ahead of time if we should build from source. after this change, we try to download precompiled binaries first, and only fall back to a source build if that fails. building from source can take up to 2 minutes, so is probably too slow for most users. Signed-off-by: Nick Santos <nick.santos@docker.com>
This commit is contained in:
		
							parent
							
								
									16c0bc4a6e
								
							
						
					
					
						commit
						f915b50e4f
					
				
							
								
								
									
										4
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										25
									
								
								src/main.ts
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								src/main.ts
									
									
									
									
									
								
							| @ -32,19 +32,32 @@ actionsToolkit.run( | |||||||
|       } |       } | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     let toolPath; |     let toolPath = ''; | ||||||
|     if (Util.isValidRef(inputs.version)) { |     let downloadFailed = false; | ||||||
|  |     if (!(await toolkit.buildx.isAvailable()) || inputs.version) { | ||||||
|  |       try { | ||||||
|  |         await core.group(`Download buildx from GitHub Releases`, async () => { | ||||||
|  |           toolPath = await toolkit.buildxInstall.download(inputs.version || 'latest'); | ||||||
|  |         }); | ||||||
|  |       } catch (e) { | ||||||
|  |         core.info(`Download buildx failed: ${e}`); | ||||||
|  |         downloadFailed = true; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (!toolPath && Util.isValidRef(inputs.version)) { | ||||||
|  |       if (downloadFailed) { | ||||||
|  |         core.info(`After failed download, falling back to building from source`); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|       if (standalone) { |       if (standalone) { | ||||||
|         throw new Error(`Cannot build from source without the Docker CLI`); |         throw new Error(`Cannot build from source without the Docker CLI`); | ||||||
|       } |       } | ||||||
|       await core.group(`Build buildx from source`, async () => { |       await core.group(`Build buildx from source`, async () => { | ||||||
|         toolPath = await toolkit.buildxInstall.build(inputs.version); |         toolPath = await toolkit.buildxInstall.build(inputs.version); | ||||||
|       }); |       }); | ||||||
|     } else if (!(await toolkit.buildx.isAvailable()) || inputs.version) { |  | ||||||
|       await core.group(`Download buildx from GitHub Releases`, async () => { |  | ||||||
|         toolPath = await toolkit.buildxInstall.download(inputs.version || 'latest'); |  | ||||||
|       }); |  | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|     if (toolPath) { |     if (toolPath) { | ||||||
|       await core.group(`Install buildx`, async () => { |       await core.group(`Install buildx`, async () => { | ||||||
|         if (standalone) { |         if (standalone) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Nick Santos
						Nick Santos