Skip to content

Commit 7df3893

Browse files
committed
Merge branch 'add-meta-toml-config'
2 parents fdd7898 + 33fb7d6 commit 7df3893

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

desktop/scripts/release/meta.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
base_urls = [
2+
"https://bunny.cdn.app.mullvad.net"
3+
]

mullvad-update/meta/src/artifacts.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use mullvad_update::{format, hash};
1212
/// See [crate::config::Config::base_urls] for the assumptions made.
1313
pub async fn generate_installer_details(
1414
architecture: format::Architecture,
15+
version: &mullvad_version::Version,
1516
base_urls: &[String],
1617
artifact: &Path,
1718
) -> anyhow::Result<format::Installer> {
@@ -36,7 +37,7 @@ pub async fn generate_installer_details(
3637
.file_name()
3738
.and_then(|f| f.to_str())
3839
.context("Unexpected filename")?;
39-
let urls = derive_urls(base_urls, filename);
40+
let urls = derive_urls(base_urls, version, filename);
4041

4142
Ok(format::Installer {
4243
architecture,
@@ -46,12 +47,16 @@ pub async fn generate_installer_details(
4647
})
4748
}
4849

49-
fn derive_urls(base_urls: &[String], filename: &str) -> Vec<String> {
50+
fn derive_urls(
51+
base_urls: &[String],
52+
version: &mullvad_version::Version,
53+
filename: &str,
54+
) -> Vec<String> {
5055
base_urls
5156
.iter()
5257
.map(|base_url| {
5358
let url = base_url.strip_suffix("/").unwrap_or(base_url);
54-
format!("{url}/{}", filename)
59+
format!("{url}/{version}/{}", filename)
5560
})
5661
.collect()
5762
}
@@ -69,8 +74,11 @@ mod test {
6974
];
7075

7176
assert_eq!(
72-
&derive_urls(&base_urls, "test.exe"),
73-
&["https://fake1.fake/test.exe", "https://fake2.fake/test.exe",]
77+
&derive_urls(&base_urls, &"2025.1".parse().unwrap(), "test.exe"),
78+
&[
79+
"https://fake1.fake/2025.1/test.exe",
80+
"https://fake2.fake/2025.1/test.exe"
81+
],
7482
);
7583
}
7684
}

mullvad-update/meta/src/platform.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ impl Platform {
307307
installers.push(
308308
artifacts::generate_installer_details(
309309
format::Architecture::Arm64,
310+
version,
310311
base_urls,
311312
&artifact,
312313
)
@@ -317,6 +318,7 @@ impl Platform {
317318
installers.push(
318319
artifacts::generate_installer_details(
319320
format::Architecture::X86,
321+
version,
320322
base_urls,
321323
&artifact,
322324
)

0 commit comments

Comments
 (0)