GitHub release fetching and platform detection for binary skills.

Platform

Detected platform info for binary downloads.

Fields

NameTypeDescription
osString
archString

Methods

detect

pub fn detect() -> Self

target_triple

pub fn target_triple(&self) -> String

match_asset

pub fn match_asset(&self, binary_name: &str, asset_names: &[String]) -> Option<String>

Match a binary name against release asset names, returning the best match.

Trait Implementations

  • Debug
  • Clone

GitHubRelease

Fields

NameTypeDescription
tag_nameString
assetsVec<GitHubAsset>

Trait Implementations

  • Debug
  • Deserialize<'de>

GitHubAsset

Fields

NameTypeDescription
nameString
browser_download_urlString

Trait Implementations

  • Debug
  • Deserialize<'de>

fetch_github_release

pub fn fetch_github_release(repo: &str, tag: Option<&str>) -> Result<GitHubRelease>

fetch_latest_release_by_tag_prefix

pub fn fetch_latest_release_by_tag_prefix(repo: &str, prefix: &str) -> Result<GitHubRelease>

Fetch the latest release whose tag starts with the given prefix.

Useful when a repo has multiple crates releasing independently (e.g. ion-v* vs ion-skill-v*).


parse_version_from_tag

pub fn parse_version_from_tag(tag: &str) -> &str

download_file

pub fn download_file(url: &str, dest: &Path) -> Result<()>

Download a file from URL to a local path.


extract_tar_gz

pub fn extract_tar_gz(archive_path: &Path, dest_dir: &Path) -> Result<Vec<PathBuf>>

Extract a .tar.gz archive to a destination directory.


find_binary_in_dir

pub fn find_binary_in_dir(dir: &Path, binary_name: &str) -> Result<PathBuf>

Find the binary executable in an extracted directory.