diff --git a/action.yml b/action.yml index b3ef96b..0c60638 100644 --- a/action.yml +++ b/action.yml @@ -11,7 +11,7 @@ inputs: Godot 4 version: e.g., 4.0.0-beta1, 4.0.0-beta.16, 4.0.0, etc. Must include major, minor, and patch (additional pre-release label is optional). Specify `global` or `global.json` to use the version from the project's global.json file. ```yaml - - uses: Mimyr-Games-LTD/setup-godot-custom@v1 + - uses: chickensoft/setup-godot-action@v1 with: version: global ``` @@ -37,18 +37,6 @@ inputs: ``` required: true - custom_url: - description: >- - Optional custom URL to download a custom Godot build. If set, the action will - download and use this build instead of determining a version from `version`. - Example: - ```yaml - - uses: Mimyr-Games-LTD/setup-godot-custom@v1 - with: - custom_url: 'https://example.com/my_custom_godot_build.zip' - ``` - required: false - default: '' path: description: >- Path to install Godot to, relative to the current working directory of diff --git a/package-lock.json b/package-lock.json index baecbb2..64565ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "normalize-path": "^3.0.0" }, "devDependencies": { - "@types/node": "^20.17.10", + "@types/node": "^20.5.7", "@typescript-eslint/parser": "^5.62.0", "@vercel/ncc": "^0.36.1", "eslint": "^8.48.0", @@ -26,7 +26,7 @@ "js-yaml": "^4.1.0", "prettier": "^2.8.8", "ts-jest": "^29.1.0", - "typescript": "^5.2.2" + "typescript": "^5.2.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1650,12 +1650,11 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.17.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", - "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", - "license": "MIT", + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~5.26.4" } }, "node_modules/@types/node-fetch": { @@ -6681,10 +6680,9 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "license": "MIT" + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/update-browserslist-db": { "version": "1.0.10", @@ -8267,11 +8265,11 @@ "dev": true }, "@types/node": { - "version": "20.17.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz", - "integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==", + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "requires": { - "undici-types": "~6.19.2" + "undici-types": "~5.26.4" } }, "@types/node-fetch": { @@ -11897,9 +11895,9 @@ } }, "undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "update-browserslist-db": { "version": "1.0.10", diff --git a/package.json b/package.json index 5d5b818..9afb8e5 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "normalize-path": "^3.0.0" }, "devDependencies": { - "@types/node": "^20.17.10", + "@types/node": "^20.5.7", "@typescript-eslint/parser": "^5.62.0", "@vercel/ncc": "^0.36.1", "eslint": "^8.48.0", diff --git a/src/main.ts b/src/main.ts index f9a7b6a..4ad36b1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,12 +21,11 @@ async function run(platform: Platform): Promise { .getInput('downloads-path') .replace(/\s/g, '') let version = core.getInput('version').replace(/\s/g, '') - const customUrl = core.getInput('custom_url').trim() const useDotnet = core.getBooleanInput('use-dotnet') const binRelativePath = core.getInput('bin-path').replace(/\s/g, '') const godotSharpRelease = core.getBooleanInput('godot-sharp-release') const checkoutDirectory = process.env['GITHUB_WORKSPACE'] ?? '' - let includeTemplates = core.getBooleanInput('include-templates') + const includeTemplates = core.getBooleanInput('include-templates') const useCache = core.getBooleanInput('cache') const userDir = os.homedir() @@ -62,38 +61,13 @@ async function run(platform: Platform): Promise { version = globalJson['msbuild-sdks']['Godot.NET.Sdk'] ?? '' } - // Определяем значения для godotUrl, versionName и exportTemplateUrl - let versionName = '' - let godotUrl = '' - let exportTemplateUrl = '' - - if (customUrl.length > 0) { - // Если задан customUrl, используем его вместо вычислений по версии - core.info(`😎 Using custom Godot build from ${customUrl}`) - versionName = 'custom_godot' - godotUrl = customUrl - - // При использовании customUrl определить экспортные шаблоны нельзя (по умолчанию их нет) - // Можно либо запретить, либо проигнорировать includeTemplates. - // Тут просто отключаем. - if (includeTemplates) { - core.info(`⚠️ Templates are not supported with custom builds. Skipping templates.`) - } - includeTemplates = false - exportTemplateUrl = '' - } else { - // Стандартная логика - versionName = getGodotFilenameFromVersionString( - version, - platform, - useDotnet - ) - godotUrl = getGodotUrl(version, platform, useDotnet, false) - exportTemplateUrl = includeTemplates - ? getGodotUrl(version, platform, useDotnet, true) - : '' - } - + // Compute derived information from Godot version. + const versionName = getGodotFilenameFromVersionString( + version, + platform, + useDotnet + ) + const godotUrl = getGodotUrl(version, platform, useDotnet, false) const godotDownloadPath = path.join(downloadsDir, `${versionName}.zip`) const godotInstallationPath = platform.getUnzippedPath( installationDir, @@ -101,6 +75,10 @@ async function run(platform: Platform): Promise { useDotnet ) const binDir = path.join(userDir, binRelativePath) + + const exportTemplateUrl = includeTemplates + ? getGodotUrl(version, platform, useDotnet, true) + : '' const exportTemplatePath = includeTemplates ? getExportTemplatePath(version, platform, useDotnet) : '' @@ -196,7 +174,7 @@ async function run(platform: Platform): Promise { core.info(`✅ Files shown`) core.endGroup() - if (includeTemplates && exportTemplateUrl) { + if (includeTemplates) { core.startGroup( `📥 Downloading Export Templates to ${exportTemplateDownloadPath}...` ) @@ -232,7 +210,10 @@ async function run(platform: Platform): Promise { exportTemplatePath ) core.info( - `✅ templates moved to ${exportTemplatePath}` + `✅ ${path.join( + path.dirname(exportTemplateExtractedPath), + 'templates' + )} moved to ${exportTemplatePath}` ) core.endGroup() diff --git a/src/utils.ts b/src/utils.ts index 318442a..93831aa 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -285,7 +285,7 @@ export async function findExecutablesRecursively( } else { // Test if file is executable. GodotSharp.dll is always considered an // executable. - let isExecutable = file.name === 'GodotSharp.dll' + let isExecutable = file.name === 'GodotSharp.dll' ? true : false if (!isExecutable) { if (platform instanceof Windows) { // fs.constants.X_OK doesn't seem to work on Windows.