Open digitalcircuit opened 3 years ago
I may be missing the point here, but this query to the GitHub API gives me the latest release:
https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1
From there, you can isolate the link to the self-hosted version and download it. I set up a PHP script that does exactly this via a daily CRON job on my server and it works great.
@bls1999 Thank you, I missed that when I was looking this up. GitHub's documentation pointed me to https://docs.github.com/en/github/administering-a-repository/linking-to-releases but that only seems to work with stable releases.
Having a static set of URLs that redirect to the latest of each artifact in the nightly releases would still be nice (no need to parse JSON with e.g. jq
), but this is still better than scraping HTML.
@bls1999 Thank you, I missed that when I was looking this up. GitHub's documentation pointed me to https://docs.github.com/en/github/administering-a-repository/linking-to-releases but that only seems to work with stable releases.
No prob! I had that problem at the start too. Happy to help. :)
Having a static set of URLs that redirect to the latest of each artifact in the nightly releases would still be nice (no need to parse JSON with e.g.
jq
), but this is still better than scraping HTML.
Ah, that makes sense. I didn't think about needing to parse the JSON in bash.
@bls1999 With the API url you've provided, I've come up with a workaround in shell using jq
…
LATEST_SELFHOSTED_URL=$(curl "https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1" | jq --raw-output ".[0].assets[] | select(.browser_download_url | endswith(\"selfhosted.zip\")).browser_download_url")
echo "Latest selfhosted.zip is at: $LATEST_SELFHOSTED_URL"
# And do whatever processing you want to do
#
# For example…
# wget "$LATEST_SELFHOSTED_URL" --output-document="selfhosted.zip"
# unzip -d "ruffle" selfhosted.zip
# echo "Updated Ruffle in 'ruffle' directory"
Sample output:
$ LATEST_SELFHOSTED_URL=$(curl "https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1" | jq --raw-output ".[0].assets[] | select(.browser_download_url | endswith(\"selfhosted.zip\")).browser_download_url")
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13900 100 13900 0 0 22601 0 --:--:-- --:--:-- --:--:-- 22601
$ echo "Latest selfhosted.zip is at: $LATEST_SELFHOSTED_URL"
Latest selfhosted.zip is at: https://github.com/ruffle-rs/ruffle/releases/download/nightly-2021-02-04/ruffle_nightly_2021_02_04_selfhosted.zip
(One can pass --silent
to curl
to silence the progress.)
I'd still prefer a simple URL one could just hand over to wget
, curl
, etc instead of stream processing JSON, but I'm sharing this here meanwhile in case it helps others.
As an alternative, I've created a short Python script that allows updating Ruffle automatically: https://github.com/n0samu/gh-update/ Another option is to use the official Ruffle CDN, as explained here: https://ruffle.rs/#usage
Describe the bug Ruffle does not seem to provide a way to download the latest release without navigating the GitHub releases page, or HTML scraping the https://ruffle.rs/ website.
Expected behavior Ruffle could have a statically named tag (e.g.
latest_nightly
) that is updated byrelease_nightly.yaml
, similar to the existing Arch package support.This would simplify automated nightly/weekly deployments of the prebuilt version of Ruffle.
Additional information The logical flow might be like this:
create-latest-nightly-release
create-nightly-release
runslatest_nightly
, using GongT/actions-recreate-release@v1Alternatively, the GitHub CI workflow could be given permission to update a static link on the ruffle.rs hosting infrastructure.
Or, if the GitHub Actions workflow uploads build artifacts (not just release artifacts),
nightly.link
could be used. See Quassel IRC's usage here to provide a stablelatest
link.Is the problem with the Ruffle desktop app, extension, or self-hosted version? It applies to all versions of Ruffle.
What platform are you using?