mirror of
				https://git.mirrors.martin98.com/https://github.com/docker/setup-docker-action
				synced 2025-10-31 15:01:09 +08:00 
			
		
		
		
	use new implementation
This commit is contained in:
		
							parent
							
								
									3e758a2d14
								
							
						
					
					
						commit
						34c4964b4a
					
				
							
								
								
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @ -29,4 +29,4 @@ jobs: | |||||||
|         name: Set up Docker |         name: Set up Docker | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
|           version: 23.0.0 |           version: v23.0.0 | ||||||
|  | |||||||
| @ -33,8 +33,6 @@ jobs: | |||||||
|       - |       - | ||||||
|         name: Set up Docker |         name: Set up Docker | ||||||
|         uses: crazy-max/ghaction-setup-docker@v1 |         uses: crazy-max/ghaction-setup-docker@v1 | ||||||
|         with: |  | ||||||
|           version: 23.0.1 |  | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ## Customizing | ## Customizing | ||||||
| @ -43,9 +41,9 @@ jobs: | |||||||
| 
 | 
 | ||||||
| Following inputs can be used as `step.with` keys | Following inputs can be used as `step.with` keys | ||||||
| 
 | 
 | ||||||
| | Name      | Type   | Description                         | | | Name      | Type   | Default  | Description                          | | ||||||
| |-----------|--------|-------------------------------------| | |-----------|--------|----------|--------------------------------------| | ||||||
| | `version` | String | Docker CE version (e.g., `23.0.1`). | | | `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`). | | ||||||
| 
 | 
 | ||||||
| ## Contributing | ## Contributing | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -17,10 +17,10 @@ describe('getInputs', () => { | |||||||
|     [ |     [ | ||||||
|       0, |       0, | ||||||
|       new Map<string, string>([ |       new Map<string, string>([ | ||||||
|         ['version', '23.0.1'], |         ['version', 'v23.0.1'], | ||||||
|       ]), |       ]), | ||||||
|       { |       { | ||||||
|         version: '23.0.1', |         version: 'v23.0.1', | ||||||
|       } as context.Inputs |       } as context.Inputs | ||||||
|     ] |     ] | ||||||
|   ])( |   ])( | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ branding: | |||||||
| 
 | 
 | ||||||
| inputs: | inputs: | ||||||
|   version: |   version: | ||||||
|     description: 'Docker CE version. (e.g, 23.0.1)' |     description: 'Docker CE version. (e.g, v23.0.1)' | ||||||
|     required: false |     required: false | ||||||
| 
 | 
 | ||||||
| runs: | runs: | ||||||
|  | |||||||
							
								
								
									
										17
									
								
								src/main.ts
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								src/main.ts
									
									
									
									
									
								
							| @ -13,18 +13,21 @@ actionsToolkit.run( | |||||||
|   // main
 |   // main
 | ||||||
|   async () => { |   async () => { | ||||||
|     const input: context.Inputs = context.getInputs(); |     const input: context.Inputs = context.getInputs(); | ||||||
|  |     const runDir = path.join(os.homedir(), `setup-docker-action-${uuid.v4()}`); | ||||||
| 
 | 
 | ||||||
|     const install = new Install(); |     const install = new Install({ | ||||||
|  |       runDir: runDir, | ||||||
|  |       version: input.version | ||||||
|  |     }); | ||||||
|     let toolDir; |     let toolDir; | ||||||
|     if (!(await Docker.isAvailable()) || input.version) { |     if (!(await Docker.isAvailable()) || input.version) { | ||||||
|       await core.group(`Download docker`, async () => { |       await core.group(`Download docker`, async () => { | ||||||
|         toolDir = await install.download(input.version || 'latest'); |         toolDir = await install.download(); | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|     if (toolDir) { |     if (toolDir) { | ||||||
|       const runDir = path.join(os.homedir(), `setup-docker-action-${uuid.v4()}`); |  | ||||||
|       stateHelper.setRunDir(runDir); |       stateHelper.setRunDir(runDir); | ||||||
|       await install.install(toolDir, runDir, input.version); |       await install.install(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     await core.group(`Docker info`, async () => { |     await core.group(`Docker info`, async () => { | ||||||
| @ -37,7 +40,9 @@ actionsToolkit.run( | |||||||
|     if (stateHelper.runDir.length == 0) { |     if (stateHelper.runDir.length == 0) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     const install = new Install(); |     const install = new Install({ | ||||||
|     await install.tearDown(stateHelper.runDir); |       runDir: stateHelper.runDir | ||||||
|  |     }); | ||||||
|  |     await install.tearDown(); | ||||||
|   } |   } | ||||||
| ); | ); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 CrazyMax
						CrazyMax