Module: Thermite::GithubReleaseBinary

Included in:
Tasks
Defined in:
lib/thermite/github_release_binary.rb

Overview

GitHub releases binary helpers.

Instance Method Summary collapse

Instance Method Details

#download_binary_from_github_releaseObject

Downloads a Rust binary from GitHub releases, given the target OS and architecture.

Requires the github_releases option to be true. It uses the repository value in the project's Cargo.toml (in the package section) to determine where the releases are located.

If the github_release_type is 'latest', it will attempt to use the appropriate binary for the latest version in GitHub releases. Otherwise, it will download the appropriate binary for the crate version given in Cargo.toml.

Returns whether a binary was found and unpacked.



42
43
44
45
46
47
48
49
50
51
# File 'lib/thermite/github_release_binary.rb', line 42

def download_binary_from_github_release
  return false unless options[:github_releases]

  case options[:github_release_type]
  when 'latest'
    download_latest_binary_from_github_release
  else # 'cargo'
    download_cargo_version_from_github_release
  end
end