|
3 | 3 | // file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
4 | 4 |
|
5 | 5 | use {
|
| 6 | + crate::release::SUFFIXES_BY_TRIPLE, |
6 | 7 | anyhow::{anyhow, Result},
|
7 | 8 | clap::ArgMatches,
|
8 | 9 | futures::StreamExt,
|
9 | 10 | octocrab::{models::workflows::WorkflowListArtifact, Octocrab, OctocrabBuilder},
|
10 |
| - once_cell::sync::Lazy, |
11 |
| - std::{ |
12 |
| - collections::{BTreeMap, BTreeSet}, |
13 |
| - io::Read, |
14 |
| - path::PathBuf, |
15 |
| - }, |
| 11 | + std::{collections::BTreeSet, io::Read, path::PathBuf}, |
16 | 12 | zip::ZipArchive,
|
17 | 13 | };
|
18 | 14 |
|
19 |
| -static SUFFIXES_BY_TRIPLE: Lazy<BTreeMap<&'static str, Vec<&'static str>>> = Lazy::new(|| { |
20 |
| - let mut h = BTreeMap::new(); |
21 |
| - |
22 |
| - // macOS. |
23 |
| - let macos_suffixes = vec!["debug", "lto", "pgo", "pgo+lto", "install_only"]; |
24 |
| - h.insert("aarch64-apple-darwin", macos_suffixes.clone()); |
25 |
| - h.insert("x86_64-apple-darwin", macos_suffixes); |
26 |
| - |
27 |
| - // Windows. |
28 |
| - let windows_suffixes = vec!["shared-pgo", "static-noopt", "shared-install_only"]; |
29 |
| - h.insert("i686-pc-windows-msvc", windows_suffixes.clone()); |
30 |
| - h.insert("x86_64-pc-windows-msvc", windows_suffixes); |
31 |
| - |
32 |
| - // Linux. |
33 |
| - let linux_suffixes_pgo = vec!["debug", "lto", "pgo", "pgo+lto", "install_only"]; |
34 |
| - let linux_suffixes_nopgo = vec!["debug", "lto", "noopt", "install_only"]; |
35 |
| - |
36 |
| - h.insert("aarch64-unknown-linux-gnu", linux_suffixes_nopgo.clone()); |
37 |
| - |
38 |
| - h.insert("i686-unknown-linux-gnu", linux_suffixes_pgo.clone()); |
39 |
| - |
40 |
| - h.insert("x86_64-unknown-linux-gnu", linux_suffixes_pgo.clone()); |
41 |
| - h.insert("x86_64_v2-unknown-linux-gnu", linux_suffixes_pgo.clone()); |
42 |
| - h.insert("x86_64_v3-unknown-linux-gnu", linux_suffixes_pgo.clone()); |
43 |
| - h.insert("x86_64_v4-unknown-linux-gnu", linux_suffixes_nopgo.clone()); |
44 |
| - h.insert("x86_64-unknown-linux-musl", linux_suffixes_nopgo.clone()); |
45 |
| - h.insert("x86_64_v2-unknown-linux-musl", linux_suffixes_nopgo.clone()); |
46 |
| - h.insert("x86_64_v3-unknown-linux-musl", linux_suffixes_nopgo.clone()); |
47 |
| - h.insert("x86_64_v4-unknown-linux-musl", linux_suffixes_nopgo.clone()); |
48 |
| - |
49 |
| - h |
50 |
| -}); |
51 |
| - |
52 | 15 | async fn fetch_artifact(client: &Octocrab, artifact: WorkflowListArtifact) -> Result<bytes::Bytes> {
|
53 | 16 | println!("downloading {}", artifact.name);
|
54 | 17 | let res = client
|
|
0 commit comments