mirror of
				https://github.com/chickensoft-games/setup-godot.git
				synced 2025-10-31 23:03:56 +00:00 
			
		
		
		
	Upgrade from node16 to node20 (#81)
This commit is contained in:
		
							parent
							
								
									1dc3741f47
								
							
						
					
					
						commit
						d83cb325fa
					
				
							
								
								
									
										14
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| @ -35,10 +35,10 @@ jobs: | |||||||
|         # Use bash shells on all platforms. |         # Use bash shells on all platforms. | ||||||
|         shell: bash |         shell: bash | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v4 | ||||||
|         name: 🧾 Checkout |         name: 🧾 Checkout | ||||||
| 
 | 
 | ||||||
|       - uses: actions/setup-dotnet@v3 |       - uses: actions/setup-dotnet@v4 | ||||||
|         if: ${{ matrix.use-dotnet }} |         if: ${{ matrix.use-dotnet }} | ||||||
|         name: 💽 Setup .NET SDK |         name: 💽 Setup .NET SDK | ||||||
|         with: |         with: | ||||||
| @ -67,7 +67,7 @@ jobs: | |||||||
|     if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name |     if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v4 | ||||||
|         name: 🧾 Checkout |         name: 🧾 Checkout | ||||||
| 
 | 
 | ||||||
|       - uses: ./ |       - uses: ./ | ||||||
| @ -85,12 +85,12 @@ jobs: | |||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
| 
 | 
 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v4 | ||||||
| 
 | 
 | ||||||
|       - name: Set Node.js 16.x |       - name: Set Node.js 20.x | ||||||
|         uses: actions/setup-node@v3 |         uses: actions/setup-node@v4 | ||||||
|         with: |         with: | ||||||
|           node-version: 16.x |           node-version: 20.x | ||||||
| 
 | 
 | ||||||
|       - name: Install dependencies |       - name: Install dependencies | ||||||
|         run: npm ci |         run: npm ci | ||||||
|  | |||||||
| @ -67,5 +67,5 @@ inputs: | |||||||
|       True will also download the Godot Export Templates for each platform. |       True will also download the Godot Export Templates for each platform. | ||||||
|     default: false |     default: false | ||||||
| runs: | runs: | ||||||
|   using: 'node16' |   using: 'node20' | ||||||
|   main: 'dist/index.js' |   main: 'dist/index.js' | ||||||
|  | |||||||
							
								
								
									
										18
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -91,9 +91,15 @@ function run(platform) { | |||||||
|         const godotDownloadPath = path_1.default.join(downloadsDir, `${versionName}.zip`); |         const godotDownloadPath = path_1.default.join(downloadsDir, `${versionName}.zip`); | ||||||
|         const godotInstallationPath = platform.getUnzippedPath(installationDir, versionName, useDotnet); |         const godotInstallationPath = platform.getUnzippedPath(installationDir, versionName, useDotnet); | ||||||
|         const binDir = path_1.default.join(userDir, binRelativePath); |         const binDir = path_1.default.join(userDir, binRelativePath); | ||||||
|         const exportTemplateUrl = includeTemplates ? (0, utils_1.getGodotUrl)(version, platform, useDotnet, true) : ''; |         const exportTemplateUrl = includeTemplates | ||||||
|         const exportTemplatePath = includeTemplates ? (0, utils_1.getExportTemplatePath)(version, platform, useDotnet) : ''; |             ? (0, utils_1.getGodotUrl)(version, platform, useDotnet, true) | ||||||
|         const exportTemplateDownloadPath = includeTemplates ? path_1.default.join(downloadsDir, 'export_templates.zip') : ''; |             : ''; | ||||||
|  |         const exportTemplatePath = includeTemplates | ||||||
|  |             ? (0, utils_1.getExportTemplatePath)(version, platform, useDotnet) | ||||||
|  |             : ''; | ||||||
|  |         const exportTemplateDownloadPath = includeTemplates | ||||||
|  |             ? path_1.default.join(downloadsDir, 'export_templates.zip') | ||||||
|  |             : ''; | ||||||
|         core.info(`🤖 Godot version: ${version}`); |         core.info(`🤖 Godot version: ${version}`); | ||||||
|         core.info(`🤖 Godot version name: ${versionName}`); |         core.info(`🤖 Godot version name: ${versionName}`); | ||||||
|         core.info(`🟣 Use .NET: ${useDotnet}`); |         core.info(`🟣 Use .NET: ${useDotnet}`); | ||||||
| @ -124,8 +130,10 @@ function run(platform) { | |||||||
|             core.endGroup(); |             core.endGroup(); | ||||||
|             // See if Godot is already installed.
 |             // See if Godot is already installed.
 | ||||||
|             core.startGroup(`🤔 Checking if Godot is already in cache...`); |             core.startGroup(`🤔 Checking if Godot is already in cache...`); | ||||||
|             const cachedPaths = includeTemplates ? [godotInstallationPath, exportTemplatePath] : [godotInstallationPath]; |             const cachedPaths = includeTemplates | ||||||
|             const cacheKey = includeTemplates ? godotUrl : godotUrl + '-no-templates'; |                 ? [godotInstallationPath, exportTemplatePath] | ||||||
|  |                 : [godotInstallationPath]; | ||||||
|  |             const cacheKey = includeTemplates ? godotUrl : `${godotUrl}-no-templates`; | ||||||
|             const cached = yield cache.restoreCache(cachedPaths.slice(), cacheKey); |             const cached = yield cache.restoreCache(cachedPaths.slice(), cacheKey); | ||||||
|             let executables; |             let executables; | ||||||
|             if (!cached) { |             if (!cached) { | ||||||
|  | |||||||
							
								
								
									
										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
											
										
									
								
							
							
								
								
									
										34
									
								
								src/main.ts
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								src/main.ts
									
									
									
									
									
								
							| @ -75,12 +75,15 @@ async function run(platform: Platform): Promise<void> { | |||||||
|   ) |   ) | ||||||
|   const binDir = path.join(userDir, binRelativePath) |   const binDir = path.join(userDir, binRelativePath) | ||||||
| 
 | 
 | ||||||
|   const exportTemplateUrl = includeTemplates ? getGodotUrl(version, platform, useDotnet, true) : '' |   const exportTemplateUrl = includeTemplates | ||||||
|   const exportTemplatePath = includeTemplates ? getExportTemplatePath(version, platform, useDotnet) : '' |     ? getGodotUrl(version, platform, useDotnet, true) | ||||||
|   const exportTemplateDownloadPath = includeTemplates ? path.join( |     : '' | ||||||
|     downloadsDir, |   const exportTemplatePath = includeTemplates | ||||||
|     'export_templates.zip' |     ? getExportTemplatePath(version, platform, useDotnet) | ||||||
|   ) : '' |     : '' | ||||||
|  |   const exportTemplateDownloadPath = includeTemplates | ||||||
|  |     ? path.join(downloadsDir, 'export_templates.zip') | ||||||
|  |     : '' | ||||||
| 
 | 
 | ||||||
|   core.info(`🤖 Godot version: ${version}`) |   core.info(`🤖 Godot version: ${version}`) | ||||||
|   core.info(`🤖 Godot version name: ${versionName}`) |   core.info(`🤖 Godot version name: ${versionName}`) | ||||||
| @ -116,12 +119,11 @@ async function run(platform: Platform): Promise<void> { | |||||||
|     // See if Godot is already installed.
 |     // See if Godot is already installed.
 | ||||||
|     core.startGroup(`🤔 Checking if Godot is already in cache...`) |     core.startGroup(`🤔 Checking if Godot is already in cache...`) | ||||||
| 
 | 
 | ||||||
|     const cachedPaths = includeTemplates ? [ godotInstallationPath, exportTemplatePath] : [ godotInstallationPath ] |     const cachedPaths = includeTemplates | ||||||
|     const cacheKey = includeTemplates ? godotUrl : godotUrl + '-no-templates' |       ? [godotInstallationPath, exportTemplatePath] | ||||||
|     const cached = await cache.restoreCache( |       : [godotInstallationPath] | ||||||
|       cachedPaths.slice(), |     const cacheKey = includeTemplates ? godotUrl : `${godotUrl}-no-templates` | ||||||
|       cacheKey |     const cached = await cache.restoreCache(cachedPaths.slice(), cacheKey) | ||||||
|     ) |  | ||||||
| 
 | 
 | ||||||
|     let executables: string[] |     let executables: string[] | ||||||
|     if (!cached) { |     if (!cached) { | ||||||
| @ -141,7 +143,6 @@ async function run(platform: Platform): Promise<void> { | |||||||
|       core.info(`✅ Godot downloaded to ${godotDownloadedPath}`) |       core.info(`✅ Godot downloaded to ${godotDownloadedPath}`) | ||||||
|       core.endGroup() |       core.endGroup() | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|       // Extract Godot
 |       // Extract Godot
 | ||||||
|       core.startGroup(`📦 Extracting Godot to ${installationDir}...`) |       core.startGroup(`📦 Extracting Godot to ${installationDir}...`) | ||||||
| 
 | 
 | ||||||
| @ -166,7 +167,6 @@ async function run(platform: Platform): Promise<void> { | |||||||
|       core.info(`✅ Files shown`) |       core.info(`✅ Files shown`) | ||||||
|       core.endGroup() |       core.endGroup() | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|       if (includeTemplates) { |       if (includeTemplates) { | ||||||
|         core.startGroup( |         core.startGroup( | ||||||
|           `📥 Downloading Export Templates to ${exportTemplateDownloadPath}...` |           `📥 Downloading Export Templates to ${exportTemplateDownloadPath}...` | ||||||
| @ -183,7 +183,6 @@ async function run(platform: Platform): Promise<void> { | |||||||
|         core.info(`✅ Export Templates downloaded to ${templateDownloadedPath}`) |         core.info(`✅ Export Templates downloaded to ${templateDownloadedPath}`) | ||||||
|         core.endGroup() |         core.endGroup() | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|         core.startGroup( |         core.startGroup( | ||||||
|           `📦 Extracting Export Templates to ${exportTemplatePath}...` |           `📦 Extracting Export Templates to ${exportTemplatePath}...` | ||||||
|         ) |         ) | ||||||
| @ -220,10 +219,7 @@ async function run(platform: Platform): Promise<void> { | |||||||
| 
 | 
 | ||||||
|       // Save extracted Godot contents to cache
 |       // Save extracted Godot contents to cache
 | ||||||
|       core.startGroup(`💾 Saving extracted Godot download to cache...`) |       core.startGroup(`💾 Saving extracted Godot download to cache...`) | ||||||
|       await cache.saveCache( |       await cache.saveCache(cachedPaths, cacheKey) | ||||||
|         cachedPaths, |  | ||||||
|         cacheKey |  | ||||||
|       ) |  | ||||||
|       core.info(`✅ Godot saved to cache`) |       core.info(`✅ Godot saved to cache`) | ||||||
|       core.endGroup() |       core.endGroup() | ||||||
|     } else { |     } else { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user