diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index b02525e7c..a05d552bf 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -251,10 +251,13 @@ fn run_build_step( Ok(()) } -const AXOUPDATER_ASSET_ROOT: &str = - "https://github.com/axodotdev/axoupdater/releases/latest/download"; +const AXOUPDATER_ASSET_ROOT: &str = "https://github.com/axodotdev/axoupdater/releases"; const AXOUPDATER_MINIMUM_VERSION: &str = "0.7.0"; +fn axoupdater_asset_root() -> String { + format!("{AXOUPDATER_ASSET_ROOT}/download/v{}", axoupdater::VERSION) +} + /// Fetches an installer executable and installs it in the expected target path. pub fn fetch_updater(dist_graph: &DistGraph, updater: &UpdaterStep) -> DistResult<()> { let ext = if updater.target_triple.is_windows() { @@ -263,7 +266,8 @@ pub fn fetch_updater(dist_graph: &DistGraph, updater: &UpdaterStep) -> DistResul ".tar.xz" }; let expected_url = format!( - "{AXOUPDATER_ASSET_ROOT}/axoupdater-cli-{}{ext}", + "{}/axoupdater-cli-{}{ext}", + axoupdater_asset_root(), updater.target_triple );