1use std::thread::{scope, sleep};
8use std::time::Duration;
9
10use tinsel::prelude::*;
11
12fn main() {
13 tinsel::install_panic_hook();
14 if std::env::args().any(|a| a == "--json") {
15 tinsel::set_output(tinsel::Output::Json);
16 }
17
18 let live = Live::new("release", "v2.1.0");
19 let build = live.step("Build");
20 let targets: Vec<Step> = ["linux-x64", "linux-arm64", "macos-arm64"]
22 .into_iter()
23 .map(|t| build.step(t))
24 .collect();
25 let publish = live.step("Publish");
26
27 build.start();
28 scope(|s| {
30 for (i, target) in targets.iter().enumerate() {
31 s.spawn(move || {
32 target.start();
33 for stage in ["compiling", "linking", "stripping"] {
34 target.detail(stage);
35 sleep(Duration::from_millis(350 + 150 * i as u64));
36 }
37 if i == 2 {
38 target.log("signed with Developer ID");
40 }
41 target.done();
42 });
43 }
44 });
45 build.done();
46
47 publish.start();
48 for i in 1..=30 {
49 let f = i as f32 / 30.0;
50 publish.progress(f, format!("{} of 3 archives", (f * 3.0).ceil()));
51 sleep(Duration::from_millis(40));
52 }
53 publish.done();
54
55 live.finish_with_card(Card::success("released").kv("tag", "v2.1.0"));
56}