Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] download build artifacts from GitHub workflows #5340

Open
eugenesvk opened this issue Jan 12, 2023 · 0 comments
Open

[Feature] download build artifacts from GitHub workflows #5340

eugenesvk opened this issue Jan 12, 2023 · 0 comments

Comments

@eugenesvk
Copy link

Feature Request

While the example below is that of a specific manifest, the request is more general

Is your feature request related to a problem? Please describe.

I wanted to check out the latest binaries for a project, but they only publish via artifacts resulting from GitHub workflows, and I couldn't figure out a way to adjust the scoop manifest (and didn't find any examples) to allow downloading such files.
You can check out this manifest with the current status

I've managed to 'fix' the checkver function by adding a powershell script that gets the date of the latest successfully built artifact, which would be a great replacement for the version.
Though as far as I understand from reading the manifest spec, scoop doesn't support dates as version, so that would have to be fixed via either of:

  • convert the date from : to some kind of .-separated pseudo-version
  • use meaningless, but seemingly monotonically increasing workflow ID
  • (more compliated) download the actual binary and parse it's -V output

(also I think that setting gh_token as a config would remove the need to use $GITHUB_API_TOKEN_READ_SCOOP mentioned in the manifest; will scoop also take care of proper API versions in the headers along with the token?)

However, I don't know what to do in the autoupdate section to actually download the zipped binary. I've pasted the script that does it, but autoupdate doesn't accept scripts, and even with gh_token set it can't for some reason download from the api url https://api.github.com/repos/libjxl/libjxl/actions/artifacts/UNIQUE_ART_ID/zip, I got an access denied error (this url gives the actual url you can use to download the zip) — otherwise I could return this UNIQUE_ART_ID in the checkver output alongside the version and regex capture it to use in a simple url property of autoupdate

So is it possible to do now and if not what would be the proper way to do it?

  • Would autoupdate need to support script property to allow powershell to handle zip download?
  • Or maybe a new https://api.github.com/... url scheme needs to be added somewhere here?

if ($url -match 'github.com/(?<owner>[^/]+)/(?<repo>[^/]+)/releases/download/(?<tag>[^/]+)/(?<file>[^/#]+)(?<filename>.*)' -and ($token = Get-GitHubToken)) {

  • something else?

One more complication: the urls you get from GitHub REST APIs (which are needed to get all the workflow/artifact lists and URLs) are "ephemereal", disappearing after 1 minute, so it doesn't actually make sense to update the manifest with their values, basically the check/update has to be always done locally.
Would this allow any manifest simplifications?

Describe the solution you'd like

I'd like scoop to allow downloading the latest binaries that are built with GitHub workflows and published as "artifacts"

Describe alternatives you've considered

Manual download is always fun :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant