Skip to content

Use the GitHub Releases API to refine the download process for CI - #327

Merged
jserv merged 2 commits into
sysprog21:masterfrom
DrXiao:ci-improve-wget-verification
Aug 24, 2026
Merged

Use the GitHub Releases API to refine the download process for CI#327
jserv merged 2 commits into
sysprog21:masterfrom
DrXiao:ci-improve-wget-verification

Conversation

@DrXiao

@DrXiao DrXiao commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

The host-x86 and host-arm jobs need to download the RISC-V GNU toolchain and fastfetch, respectively. However, both jobs rely on hard-coded URLs to download the required files, and only the toolchain archive is verified by a fixed SHA256 checksum.

Therefore, the proposed changes introduce the use of the GitHub Releases API to improve the CI flow. The two jobs now use the GitHub Releases API to obtain the release metadata of the target files first, then sequentially perform URL/SHA256 retrieval, download, verification, and installation steps.

As a result, the jobs can always automatically download and install the latest releases without requiring manual updates to the download URLs or checksums.


Summary by cubic

CI now uses the GitHub Releases API to resolve, download, and SHA‑256 verify the RISC‑V toolchain (host‑x86) and fastfetch (host‑arm), replacing hard‑coded URLs. This keeps jobs on the latest assets and adds checksum verification for fastfetch.

  • Behavior change: always pulls the latest releases from riscv-collab/riscv-gnu-toolchain and fastfetch-cli/fastfetch; build results may vary between runs.
  • Flow: parse .browser_download_url and .digest with jq, download to /tmp, verify with sha256sum, then extract to /opt and append /opt/riscv/bin to GITHUB_PATH (toolchain) or install via dpkg (fastfetch).
  • Operational notes: uses GITHUB_TOKEN for API calls; steps fail on API or checksum errors; assumes asset names riscv32-glibc-ubuntu-24.04-gcc.tar.xz and fastfetch-linux-aarch64.deb.

Written for commit 5940a93. Summary will update on new commits.

Review in cubic

cubic-dev-ai[bot]

This comment was marked as resolved.

@DrXiao
DrXiao force-pushed the ci-improve-wget-verification branch 3 times, most recently from db5b4ca to 66acfac Compare August 24, 2026 05:59
DrXiao added 2 commits August 24, 2026 14:07
The host-x86 CI job contains a step to download and verifies the RISC-V
GNU toolchain using a fixed URL and a SHA-256 value. This approach means
the version may need to be bumped every time a new release comes out.

Therefore, this CI step is improved by introducing the use of the GitHub
Releases API, which can directly retrieve a JSON-formatted data about
the latest release information. Since the reponse data contains the URL
and SHA-256 of the latest release file(s), this step now sends a request
to GitHub to obtain the URL and SHA-256 first, and then performs
downlaod and verification process for the latest release toolchain.
The original fastfetch download process retrieved the archive directly
via a fixed URL and performed installation without any verification.

This step has now been enhanced by using the GitHub Releases API to
first retrieve the URL and SHA256 checksum of the target file, and then
sequentially perform the download, verification, and installation
process using the previously obtained data.
@DrXiao
DrXiao force-pushed the ci-improve-wget-verification branch from 66acfac to 5940a93 Compare August 24, 2026 06:08
@jserv
jserv merged commit 6863aeb into sysprog21:master Aug 24, 2026
16 checks passed
@jserv

jserv commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Thank @DrXiao for contributing!

@DrXiao
DrXiao deleted the ci-improve-wget-verification branch August 24, 2026 06:13
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.

2 participants