Skip to content

Commit af9bdf1

Browse files
Merge pull request #1179 from winston-yallow/improved-downlaods
Use our own download server
2 parents 368a2b8 + 6c8851a commit af9bdf1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

_plugins/make_download.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# See `_data/download_configs.yml` for a reference table of slugs.
44

55
HOST_TUXFAMILY = "https://downloads.tuxfamily.org/godotengine"
6-
HOST_GITHUB = "https://github.com/godotengine/godot/releases/download"
7-
HOST_GITHUB_BUILDS = "https://github.com/godotengine/godot-builds/releases/download"
6+
HOST_HETZNER = "https://downloads.godotengine.org"
87

98
FLAVOR_MATRIX = {
109
"dev" => 1,
@@ -105,10 +104,9 @@ def make_download(input, platform, mono = false, host = "github")
105104
end
106105
end
107106

108-
if host == "github"
109-
return "#{HOST_GITHUB}/#{version_name}-#{version_flavor}/#{download_file}"
110-
elsif host == "github_builds"
111-
return "#{HOST_GITHUB_BUILDS}/#{version_name}-#{version_flavor}/#{download_file}"
107+
if host == "github" or host == "github_builds"
108+
# Use our custom download API that supports all github builds but will prefer S3 downloads
109+
return "#{HOST_HETZNER}?version=#{version_name}&flavor=#{version_flavor}&slug=#{download_slug}&platform=#{platform}"
112110
elsif host == "tuxfamily"
113111
if version_flavor == "stable"
114112
return "#{HOST_TUXFAMILY}/#{version_name}#{mono_slug}/#{download_file}"

0 commit comments

Comments
 (0)