Closed colindean closed 1 year ago
Very cool, thanks for working on that.
I notice my versioning scheme is causing some issues, would it help if I was to provide an update manifest of some sort for bridge releases?
I'll hold off on merging this for now, since I'd like to mention one of the AUR packages in there too, but I'm also happy to put it in a more prominent location near the bridge download buttons as an alternative install option.
Thanks for looking a little deeper into the process that created the Homebrew cask!
Yes, if you could provide a manifest on your site or perhaps in the GitHub Releases assets for each release, or just some way of telling with one HTTP request what is the latest bridge version, that'd simplify the livecheck update infrastructure. We've got it working now but we try to avoid using the GitHub API for anything in livecheck so that we don't hit our API limit (which I understand is higher than the general public but still we test that limit regularly).
It could be something as simple as a latest.txt
in each releases assets that looks like:
xpi v1.2.3
bridge v1.2.0
or perhaps by OS:
xpi v1.2.3
bridge-macos v1.2.0
bridge-windows v1.2.1
bridge-linux v1.2.3
if they can ever get disjoint.
Space-separated text is cool but going into JSON would be OK, too.
{
"version":"v1.2.3",
"xpi": "v1.2.3",
"bridge": {
"macos":"v1.2.0",
"windows":"v1.2.1",
"linux":"v1.2.3"
}
}
Bridge versions are consistent across platforms, so I'm happy to go with a latest.txt
in the release assets with this format if that works for you:
extension v0.3.1
bridge v0.3.0
I think that will work. I'll ping the cask team to confirm. Hold off unless it's a really small task.
Would it be possible to put the content I proposed for latest.txt
into the release description itself? E.g. for https://github.com/hensm/fx_cast/releases/tag/v0.3.1 in a section "Latest Compatible Versions" inside of a fenced codeblock (eh, it'll render as a pre
) in the format from https://github.com/hensm/fx_cast/pull/262#issuecomment-1445215235?
Another thing I thought of is this: could you add bridge information to https://hensm.github.io/fx_cast/updates.json? Its source appears to be https://github.com/hensm/fx_cast/blob/master/docs/updates.json and appears to be manually managed. Maybe something like:
{
"addons": { "…what's already there" },
"bridge": [
"updates": [
{ "version": "v1.2.3" },
{ "version": "v1.2.4" }
]
]
}
It's be really cool if this had the URL and SHA256 all in one, I think, but since this file appears to be manually managed, that might be some extra work not really worth it when all Homebrew really needs is the tag/release, from which it can go look up the artifacts.
Looking at how Firefox handles parsing for extension update manifests, it should be safe to add custom properties.
I don't mind adding update URL/hash entries for the bridge too, since I could simplify some of the code in the extension and on the site by using that instead of calling the GitHub API and trying to figure out what the last bridge release was.
Would just need to decide on a format as it needs to represent multiple platforms/architectures.
I'm thinking I'll go with this format:
{
"addons": {
"fx_cast@matt.tf": {
"updates": [
{
"version": "0.3.0",
"update_link": "https://github.com/hensm/fx_cast/releases/download/v0.3.0/fx_cast-0.3.0.xpi",
"update_hash": "sha256:c9b5a9be95913518bee469d7cc4dfadd55db27a289ce4c81b809b8be29184045"
},
{
"version": "0.3.1",
"update_link": "https://github.com/hensm/fx_cast/releases/download/v0.3.1/fx_cast-0.3.1.xpi",
"update_hash": "sha256:cda627509a4991100f482a4cdd2db43e3312e1a781b501a15c1db081d9459124"
}
]
}
},
"fx_cast_bridge": {
"updates": [
{
"version": "v0.2.0",
"platforms": { "...": "..." }
},
{
"version": "v0.3.0",
"platforms": {
"mac": {
"arm64": {
"update_link": "https://github.com/hensm/fx_cast/releases/download/v0.3.0/fx_cast_bridge-0.3.0-arm64.pkg",
"update_hash": "sha256:2e8dd783be80c21b5b25615284046df7ea7322dba80e96f09c93a329f3f6b6fb"
},
"x64": {
"update_link": "https://github.com/hensm/fx_cast/releases/download/v0.3.0/fx_cast_bridge-0.3.0-x64.pkg",
"update_hash": "sha256:f24e347fd240d5e74b488c83aee8c939b5abf7498dd047b4d3cdb5912a71e8aa"
}
},
"win": {
"x64": {
"update_link": "https://github.com/hensm/fx_cast/releases/download/v0.3.0/fx_cast_bridge-0.3.0-x64.exe",
"update_hash": "sha256:775f4b278c1d8b551d9dcae70468cafd0fb3ab4afdaaab505efffb062a93c520"
}
},
"linux-deb": {
"x64": {
"update_link": "https://github.com/hensm/fx_cast/releases/download/v0.3.0/fx_cast_bridge-0.3.0-x64.deb",
"update_hash": "sha256:0abb90d5cf4d1452b5aaed3f61fc456ec4722ca97f3dca834175fc6b236d1e19"
}
},
"linux-rpm": {
"x64": {
"update_link": "https://github.com/hensm/fx_cast/releases/download/v0.3.0/fx_cast_bridge-0.3.0-x64.rpm",
"update_hash": "sha256:98df8f1d1b727bc1ff87276fd13b5ff6b05538ac412f6a5e1044a914011f3ddc"
}
}
}
}
]
}
}
type UpdateManifestPlatform = "mac" | "win" | "linux-deb" | "linux-rpm";
type UpdateManifestArch = "x86" | "x64" | "arm64";
interface UpdateManifestUpdateInfo {
update_link: string;
update_hash: string;
}
interface UpdateManifestUpdate {
version: string;
platforms: Record<
UpdateManifestPlatform,
Partial<Record<UpdateManifestArch, UpdateManifestUpdateInfo>>
>;
}
interface UpdateManifest {
fx_cast_bridge: {
updates: UpdateManifestUpdate[];
};
}
That'd be awesome. @-mention me when that's live and we'll get it live in Homebrew shortly thereafter.
@colindean Tested extension updates and it's working fine, so it's live now. https://hensm.github.io/fx_cast/updates.json
fx-cast-bridge was added to Homebrew's Casks in https://github.com/Homebrew/homebrew-cask/pull/141788 so let's mention it on the FAQ.
It could be more prominent on the page but I didn't want to add a new section unnecessarily so the FAQ seemed OK.