mirror of
https://github.com/chickensoft-games/setup-godot.git
synced 2025-08-15 05:15:07 +00:00
Revert "feat: add custom url"
This reverts commit f101ebc4a56111d275e0d1451cc0cf328155c73c.
This commit is contained in:
parent
f101ebc4a5
commit
300abc3218
14
action.yml
14
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.
|
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
|
```yaml
|
||||||
- uses: Mimyr-Games-LTD/setup-godot-custom@v1
|
- uses: chickensoft/setup-godot-action@v1
|
||||||
with:
|
with:
|
||||||
version: global
|
version: global
|
||||||
```
|
```
|
||||||
@ -37,18 +37,6 @@ inputs:
|
|||||||
<Project Sdk="Godot.NET.Sdk/4.0.0"> <!-- BAD -->
|
<Project Sdk="Godot.NET.Sdk/4.0.0"> <!-- BAD -->
|
||||||
```
|
```
|
||||||
required: true
|
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:
|
path:
|
||||||
description: >-
|
description: >-
|
||||||
Path to install Godot to, relative to the current working directory of
|
Path to install Godot to, relative to the current working directory of
|
||||||
|
34
package-lock.json
generated
34
package-lock.json
generated
@ -16,7 +16,7 @@
|
|||||||
"normalize-path": "^3.0.0"
|
"normalize-path": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.17.10",
|
"@types/node": "^20.5.7",
|
||||||
"@typescript-eslint/parser": "^5.62.0",
|
"@typescript-eslint/parser": "^5.62.0",
|
||||||
"@vercel/ncc": "^0.36.1",
|
"@vercel/ncc": "^0.36.1",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.48.0",
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aashutoshrathi/word-wrap": {
|
"node_modules/@aashutoshrathi/word-wrap": {
|
||||||
@ -1650,12 +1650,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.17.10",
|
"version": "20.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
|
||||||
"integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==",
|
"integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~6.19.2"
|
"undici-types": "~5.26.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node-fetch": {
|
"node_modules/@types/node-fetch": {
|
||||||
@ -6681,10 +6680,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "6.19.8",
|
"version": "5.26.5",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
||||||
"license": "MIT"
|
|
||||||
},
|
},
|
||||||
"node_modules/update-browserslist-db": {
|
"node_modules/update-browserslist-db": {
|
||||||
"version": "1.0.10",
|
"version": "1.0.10",
|
||||||
@ -8267,11 +8265,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "20.17.10",
|
"version": "20.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
|
||||||
"integrity": "sha512-/jrvh5h6NXhEauFFexRin69nA0uHJ5gwk4iDivp/DeoEua3uwCUto6PC86IpRITBOs4+6i2I56K5x5b6WYGXHA==",
|
"integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"undici-types": "~6.19.2"
|
"undici-types": "~5.26.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/node-fetch": {
|
"@types/node-fetch": {
|
||||||
@ -11897,9 +11895,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"undici-types": {
|
"undici-types": {
|
||||||
"version": "6.19.8",
|
"version": "5.26.5",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
||||||
},
|
},
|
||||||
"update-browserslist-db": {
|
"update-browserslist-db": {
|
||||||
"version": "1.0.10",
|
"version": "1.0.10",
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"normalize-path": "^3.0.0"
|
"normalize-path": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.17.10",
|
"@types/node": "^20.5.7",
|
||||||
"@typescript-eslint/parser": "^5.62.0",
|
"@typescript-eslint/parser": "^5.62.0",
|
||||||
"@vercel/ncc": "^0.36.1",
|
"@vercel/ncc": "^0.36.1",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.48.0",
|
||||||
|
53
src/main.ts
53
src/main.ts
@ -21,12 +21,11 @@ async function run(platform: Platform): Promise<void> {
|
|||||||
.getInput('downloads-path')
|
.getInput('downloads-path')
|
||||||
.replace(/\s/g, '')
|
.replace(/\s/g, '')
|
||||||
let version = core.getInput('version').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 useDotnet = core.getBooleanInput('use-dotnet')
|
||||||
const binRelativePath = core.getInput('bin-path').replace(/\s/g, '')
|
const binRelativePath = core.getInput('bin-path').replace(/\s/g, '')
|
||||||
const godotSharpRelease = core.getBooleanInput('godot-sharp-release')
|
const godotSharpRelease = core.getBooleanInput('godot-sharp-release')
|
||||||
const checkoutDirectory = process.env['GITHUB_WORKSPACE'] ?? ''
|
const checkoutDirectory = process.env['GITHUB_WORKSPACE'] ?? ''
|
||||||
let includeTemplates = core.getBooleanInput('include-templates')
|
const includeTemplates = core.getBooleanInput('include-templates')
|
||||||
const useCache = core.getBooleanInput('cache')
|
const useCache = core.getBooleanInput('cache')
|
||||||
|
|
||||||
const userDir = os.homedir()
|
const userDir = os.homedir()
|
||||||
@ -62,38 +61,13 @@ async function run(platform: Platform): Promise<void> {
|
|||||||
version = globalJson['msbuild-sdks']['Godot.NET.Sdk'] ?? ''
|
version = globalJson['msbuild-sdks']['Godot.NET.Sdk'] ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// Определяем значения для godotUrl, versionName и exportTemplateUrl
|
// Compute derived information from Godot version.
|
||||||
let versionName = ''
|
const versionName = getGodotFilenameFromVersionString(
|
||||||
let godotUrl = ''
|
version,
|
||||||
let exportTemplateUrl = ''
|
platform,
|
||||||
|
useDotnet
|
||||||
if (customUrl.length > 0) {
|
)
|
||||||
// Если задан customUrl, используем его вместо вычислений по версии
|
const godotUrl = getGodotUrl(version, platform, useDotnet, false)
|
||||||
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)
|
|
||||||
: ''
|
|
||||||
}
|
|
||||||
|
|
||||||
const godotDownloadPath = path.join(downloadsDir, `${versionName}.zip`)
|
const godotDownloadPath = path.join(downloadsDir, `${versionName}.zip`)
|
||||||
const godotInstallationPath = platform.getUnzippedPath(
|
const godotInstallationPath = platform.getUnzippedPath(
|
||||||
installationDir,
|
installationDir,
|
||||||
@ -101,6 +75,10 @@ async function run(platform: Platform): Promise<void> {
|
|||||||
useDotnet
|
useDotnet
|
||||||
)
|
)
|
||||||
const binDir = path.join(userDir, binRelativePath)
|
const binDir = path.join(userDir, binRelativePath)
|
||||||
|
|
||||||
|
const exportTemplateUrl = includeTemplates
|
||||||
|
? getGodotUrl(version, platform, useDotnet, true)
|
||||||
|
: ''
|
||||||
const exportTemplatePath = includeTemplates
|
const exportTemplatePath = includeTemplates
|
||||||
? getExportTemplatePath(version, platform, useDotnet)
|
? getExportTemplatePath(version, platform, useDotnet)
|
||||||
: ''
|
: ''
|
||||||
@ -196,7 +174,7 @@ async function run(platform: Platform): Promise<void> {
|
|||||||
core.info(`✅ Files shown`)
|
core.info(`✅ Files shown`)
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
if (includeTemplates && exportTemplateUrl) {
|
if (includeTemplates) {
|
||||||
core.startGroup(
|
core.startGroup(
|
||||||
`📥 Downloading Export Templates to ${exportTemplateDownloadPath}...`
|
`📥 Downloading Export Templates to ${exportTemplateDownloadPath}...`
|
||||||
)
|
)
|
||||||
@ -232,7 +210,10 @@ async function run(platform: Platform): Promise<void> {
|
|||||||
exportTemplatePath
|
exportTemplatePath
|
||||||
)
|
)
|
||||||
core.info(
|
core.info(
|
||||||
`✅ templates moved to ${exportTemplatePath}`
|
`✅ ${path.join(
|
||||||
|
path.dirname(exportTemplateExtractedPath),
|
||||||
|
'templates'
|
||||||
|
)} moved to ${exportTemplatePath}`
|
||||||
)
|
)
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ export async function findExecutablesRecursively(
|
|||||||
} else {
|
} else {
|
||||||
// Test if file is executable. GodotSharp.dll is always considered an
|
// Test if file is executable. GodotSharp.dll is always considered an
|
||||||
// executable.
|
// executable.
|
||||||
let isExecutable = file.name === 'GodotSharp.dll'
|
let isExecutable = file.name === 'GodotSharp.dll' ? true : false
|
||||||
if (!isExecutable) {
|
if (!isExecutable) {
|
||||||
if (platform instanceof Windows) {
|
if (platform instanceof Windows) {
|
||||||
// fs.constants.X_OK doesn't seem to work on Windows.
|
// fs.constants.X_OK doesn't seem to work on Windows.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user