fix: use GitHub for downloads

This commit is contained in:
Joanna May 2023-11-14 22:33:04 -06:00
parent 650951f987
commit bcf5d5acc9
4 changed files with 37 additions and 36 deletions

View File

@ -40,75 +40,75 @@ describe('getGodotUrl', () => {
expect(
getGodotUrl('4.0.0-beta1', getPlatform('linux'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_linux_x86_64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_mono_linux_x86_64.zip'
)
expect(
getGodotUrl('4.0.0-beta1', getPlatform('win32'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_win64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_mono_win64.zip'
)
expect(
getGodotUrl('4.0.0-beta1', getPlatform('darwin'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_macos.universal.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_mono_macos.universal.zip'
)
expect(
getGodotUrl('4.0.0-beta1', getPlatform('linux'), true, true)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_export_templates.tpz'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_mono_export_templates.tpz'
)
})
test('4.0.0-beta.16', () => {
expect(
getGodotUrl('4.0.0-beta.16', getPlatform('linux'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/mono/Godot_v4.0-beta16_mono_linux_x86_64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta16/Godot_v4.0-beta16_mono_linux_x86_64.zip'
)
expect(
getGodotUrl('4.0.0-beta.16', getPlatform('win32'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/mono/Godot_v4.0-beta16_mono_win64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta16/Godot_v4.0-beta16_mono_win64.zip'
)
expect(
getGodotUrl('4.0.0-beta.16', getPlatform('darwin'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/mono/Godot_v4.0-beta16_mono_macos.universal.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta16/Godot_v4.0-beta16_mono_macos.universal.zip'
)
})
test('4.0.0-beta8', () => {
expect(
getGodotUrl('4.0.0-beta8', getPlatform('linux'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta8/mono/Godot_v4.0-beta8_mono_linux_x86_64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta8/Godot_v4.0-beta8_mono_linux_x86_64.zip'
)
expect(
getGodotUrl('4.0.0-beta8', getPlatform('win32'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta8/mono/Godot_v4.0-beta8_mono_win64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta8/Godot_v4.0-beta8_mono_win64.zip'
)
expect(
getGodotUrl('4.0.0-beta8', getPlatform('darwin'), true, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta8/mono/Godot_v4.0-beta8_mono_macos.universal.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta8/Godot_v4.0-beta8_mono_macos.universal.zip'
)
})
test('4.0.0', () => {
expect(getGodotUrl('4.0.0', getPlatform('linux'), true, false)).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0-stable_mono_linux_x86_64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-stable/Godot_v4.0-stable_mono_linux_x86_64.zip'
)
expect(getGodotUrl('4.0.0', getPlatform('win32'), true, false)).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0-stable_mono_win64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-stable/Godot_v4.0-stable_mono_win64.zip'
)
expect(getGodotUrl('4.0.0', getPlatform('darwin'), true, false)).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0-stable_mono_macos.universal.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-stable/Godot_v4.0-stable_mono_macos.universal.zip'
)
expect(getGodotUrl('4.0.0', getPlatform('linux'), true, true)).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/mono/Godot_v4.0-stable_mono_export_templates.tpz'
'https://github.com/godotengine/godot-builds/releases/download/4.0-stable/Godot_v4.0-stable_mono_export_templates.tpz'
)
})
test('3.5.2', () => {
expect(getGodotUrl('3.5.2', getPlatform('linux'), true, true)).toEqual(
'https://downloads.tuxfamily.org/godotengine/3.5.2/mono/Godot_v3.5.2-stable_mono_export_templates.tpz'
'https://github.com/godotengine/godot-builds/releases/download/3.5.2-stable/Godot_v3.5.2-stable_mono_export_templates.tpz'
)
})
})
@ -118,49 +118,49 @@ describe('getGodotUrl', () => {
expect(
getGodotUrl('4.0.0-beta1', getPlatform('linux'), false, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_linux.x86_64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_linux.x86_64.zip'
)
expect(
getGodotUrl('4.0.0-beta1', getPlatform('win32'), false, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_win64.exe.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_win64.exe.zip'
)
expect(
getGodotUrl('4.0.0-beta1', getPlatform('darwin'), false, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_macos.universal.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_macos.universal.zip'
)
expect(
getGodotUrl('4.0.0-beta1', getPlatform('darwin'), false, true)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_export_templates.tpz'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta1/Godot_v4.0-beta1_export_templates.tpz'
)
})
test('4.0.0-beta.16', () => {
expect(
getGodotUrl('4.0.0-beta.16', getPlatform('linux'), false, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/Godot_v4.0-beta16_linux.x86_64.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta16/Godot_v4.0-beta16_linux.x86_64.zip'
)
expect(
getGodotUrl('4.0.0-beta.16', getPlatform('win32'), false, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/Godot_v4.0-beta16_win64.exe.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta16/Godot_v4.0-beta16_win64.exe.zip'
)
expect(
getGodotUrl('4.0.0-beta.16', getPlatform('darwin'), false, false)
).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/Godot_v4.0-beta16_macos.universal.zip'
'https://github.com/godotengine/godot-builds/releases/download/4.0-beta16/Godot_v4.0-beta16_macos.universal.zip'
)
})
test('4.0.0', () => {
expect(getGodotUrl('4.0.0', getPlatform('linux'), false, true)).toEqual(
'https://downloads.tuxfamily.org/godotengine/4.0/Godot_v4.0-stable_export_templates.tpz'
'https://github.com/godotengine/godot-builds/releases/download/4.0-stable/Godot_v4.0-stable_export_templates.tpz'
)
})
test('3.5.2', () => {
expect(getGodotUrl('3.5.2', getPlatform('linux'), false, true)).toEqual(
'https://downloads.tuxfamily.org/godotengine/3.5.2/Godot_v3.5.2-stable_export_templates.tpz'
'https://github.com/godotengine/godot-builds/releases/download/3.5.2-stable/Godot_v3.5.2-stable_export_templates.tpz'
)
})
})

10
dist/index.js generated vendored
View File

@ -331,7 +331,7 @@ class MacOS {
}
exports.MacOS = MacOS;
/** Godot download url prefix. */
const GODOT_URL_PREFIX = 'https://downloads.tuxfamily.org/godotengine/';
const GODOT_URL_PREFIX = 'https://github.com/godotengine/godot-builds/releases/download/';
/** Godot filename prefix. */
const GODOT_FILENAME_PREFIX = 'Godot_v';
/**
@ -369,12 +369,12 @@ function getGodotUrl(versionString, platform, useDotnet, isTemplate) {
if (patch !== '' && patch !== '0') {
url += `.${patch}`;
}
url += '/';
if (label !== '') {
url += `${label}/`;
url += `-${label}/`;
}
else {
url += '-stable/';
}
if (useDotnet)
url += `mono/`;
if (!isTemplate)
return `${url}${getGodotFilename(version, platform, useDotnet)}.zip`;
return `${url}${getGodotFilenameBase(version)}${useDotnet ? '_mono' : ''}_export_templates.tpz`;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -108,7 +108,8 @@ interface SemanticVersion {
}
/** Godot download url prefix. */
const GODOT_URL_PREFIX = 'https://downloads.tuxfamily.org/godotengine/'
const GODOT_URL_PREFIX =
'https://github.com/godotengine/godot-builds/releases/download/'
/** Godot filename prefix. */
const GODOT_FILENAME_PREFIX = 'Godot_v'
@ -156,12 +157,12 @@ export function getGodotUrl(
if (patch !== '' && patch !== '0') {
url += `.${patch}`
}
url += '/'
if (label !== '') {
url += `${label}/`
}
if (useDotnet) url += `mono/`
if (label !== '') {
url += `-${label}/`
} else {
url += '-stable/'
}
if (!isTemplate)
return `${url}${getGodotFilename(version, platform, useDotnet)}.zip`