godotengine / godot-commit-artifacts

A tool providing quick links to latest CI builds of development branches
https://godotengine.github.io/godot-commit-artifacts/
MIT License
8 stars 4 forks source link

Files cannot be retrieved programmatically #2

Open umarcor opened 1 year ago

umarcor commented 1 year ago

When curl or get are used to get latest linux-editor-mono or linux-template-minimal, instead of downloading the zipfiles, HTML pages are written. See https://github.com/umarcor/godot-commit-artifacts/commit/577ee335e2f8058051d51dbb2996f86b25c948bc and https://github.com/umarcor/godot-commit-artifacts/actions/runs/4548687288/jobs/8019967935:

<!DOCTYPE html>
<html lang="en-US">
  <meta charset="utf-8">
  <title>Redirecting&hellip;</title>
  <link rel="canonical" href="https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309">
  <script>location="https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309"</script>
  <meta http-equiv="refresh" content="0; url=https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309">
  <meta name="robots" content="noindex">
  <h1>Redirecting&hellip;</h1>
  <a href="https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309">Click here if you are not redirected.</a>
</html>
--2023-03-28 23:45:11--  https://godotengine.github.io/godot-commit-artifacts/download/godotengine/godot/master/linux-editor-mono
Resolving godotengine.github.io (godotengine.github.io)... 185.199.108.153, 185.199.110.153, 185.199.111.153, ...
Connecting to godotengine.github.io (godotengine.github.io)|185.199.108.153|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://godotengine.github.io/godot-commit-artifacts/download/godotengine/godot/master/linux-editor-mono/ [following]
--2023-03-28 23:45:11--  https://godotengine.github.io/godot-commit-artifacts/download/godotengine/godot/master/linux-editor-mono/
Reusing existing connection to godotengine.github.io:443.
HTTP request sent, awaiting response... 200 OK
Length: 645 [text/html]
Saving to: ‘linux-editor-mono’

     0K                                                       100% 1.95M=0s

2023-03-28 23:45:11 (1.95 MB/s) - ‘linux-editor-mono’ saved [645/645]

<!DOCTYPE html>
<html lang="en-US">
  <meta charset="utf-8">
  <title>Redirecting&hellip;</title>
  <link rel="canonical" href="https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309">
  <script>location="https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309"</script>
  <meta http-equiv="refresh" content="0; url=https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309">
  <meta name="robots" content="noindex">
  <h1>Redirecting&hellip;</h1>
  <a href="https://github.com/godotengine/godot/suites/11869467969/artifacts/620727309">Click here if you are not redirected.</a>
</html>

I though I might download the JSON files (https://github.com/godotengine/godot-commit-artifacts/tree/gh-pages/data), for instance https://godotengine.github.io/godot-commit-artifacts/data/godotengine.godot.master.json, but I can't see how to get the URL from there without reimplementing the logic.

YuriSizov commented 1 year ago

I don't think it's possible to implement a redirect in any other way due to the "serverless" aspect of GH Pages, but I can output a JSON with target links, if it helps.

E.g. it can be some /download/godotengine/godot/master/latest.json with the mapping for artifact name and the URL as a top-level object.

umarcor commented 1 year ago

That would certainly help!