Use swift.org metadata instead of GitHub API's for toolchain selection
There are some comments in the code about using swift.org metadata about toolchain versions in toolchain search and selection instead of the GitHub API's. This would reduce the site dependencies of swiftly and help to make it dependent on one source of truth. This issue exists to track what is only mentioned in the code.
The swift.org website now has this metadata available since it was merged here: https://github.com/swiftlang/swift-org-website/pull/720
For example, you can fetch this URL to get the 6.0 snapshot toolchains for Amazon Linux 2:
curl -L swift.org/api/v1/install/dev/6.0/amazonlinux2.json
That PR referenced doesn't include the new platforms eg ubuntu2404
Do you know if since then these platforms are included?
I'm not sure about the PR that added it, but ubuntu2204 seems to be working:
curl -L swift.org/api/v1/install/dev/6.0/ubuntu2204.json
What about ubuntu2404? I know swiftly doesn't yet support it but the swift.org site has downloads for them
Yes, it appears that there are some release downloads that show up in the metadata:
curl -L swift.org/api/v1/install/dev/releases.json
...
"tag": "swift-5.10.1-RELEASE",
"xcode": "Xcode 15.3",
"xcode_release": false,
"date": "2024-06-05",
"platforms": [
...
{
"name": "Ubuntu 22.04",
"platform": "Linux",
"docker": "5.10.1-jammy",
"archs": [
"x86_64",
"aarch64"
]
},
{
"name": "Ubuntu 23.10",
"platform": "Linux",
"docker": "5.10.1-mantic",
"archs": [
"x86_64",
"aarch64"
]
},
{
"name": "Ubuntu 24.04",
"platform": "Linux",
"docker": "5.10.1-noble",
"archs": [
"x86_64",
"aarch64"
]
},
...
There's no metadata for 2404 for the 6.0 (ie. main) snapshots, but the downloads page doesn't have any downloads either.
This is now merged into main.