Skip to content

SpecialK: Add option to download latest nightly from GitHub Actions#977

Merged
sonic2kk merged 4 commits intomasterfrom
spek-nightly
Nov 16, 2023
Merged

SpecialK: Add option to download latest nightly from GitHub Actions#977
sonic2kk merged 4 commits intomasterfrom
spek-nightly

Conversation

@sonic2kk
Copy link
Owner

Implements most of #975.

This PR adds logic to fetch the latest GitHub Actions nightly archive. Since the archive name is not fixed, we do this by using fetchLatestGitHubActionsBuild to get the latest workflow commit hash for the relevant workflow name we want, then build the nightly.link URL for the page that will list the latest GitHub Actions build, wget it, and parse out the artifact archive nightly.link download URL we want based on a pattern for how our desired archive name will look.

Once we have this, we set the basename of this ZIP download URL to the SPEKARC which is the destination path for the archive. extSpek takes care of extracting it, and the rest of the paths are built dynamically based on the version name, so the rest of the SpecialK installation logic works without any tweaks.

We did have to make a couple of changes to achieve this:

  • SPEKDL is now set after wee set the SPEKDLURL, because the nightly option overrides SPEKARC since in this case, it's a ZIP instead of a 7z file.
  • extSpek can now extract ZIP archives and checks the file extension to do this
  • fetchLatestGitHubActionsBuild was tweaked to now optionally take a name to fetch the first workflow from. For SpecialK it was pulling from its CodeQL workflow. Now we filter the workflow API response with jq.

This branch was tested in #975 and should work, and it also works in my tests, so I will merge it soon. In future, other changes to allow custom SpecialK versions may be implemented as well.

@sonic2kk
Copy link
Owner Author

Need to bump langfiles.

@sonic2kk
Copy link
Owner Author

Added some more logging, updated langfiles, and bumped the version. ShellCheck is green on this so I think it's ready to merge. I also gave a brief mention to the nightly release on our SpecialK wiki page.

@sonic2kk sonic2kk merged commit 2113467 into master Nov 16, 2023
@sonic2kk sonic2kk deleted the spek-nightly branch November 16, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant