Skip to content

Commit c664732

Browse files
committed
build: update actifact
1 parent 1f8ff7a commit c664732

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

crates/tools/dev/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ edition.workspace = true
55

66
[dependencies]
77
clap = { version = "4.4.18", features = ["derive", "cargo"] }
8-
zip = "0.6.6"
98

109
[dev-dependencies]
1110
cargo-husky = { version = "1", default-features = false, features = [

crates/tools/dev/src/main.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ fn fmt() {
7474
}
7575

7676
fn build(target: &str) {
77+
if env::var("GITHUB_ACTIONS").is_ok() && cfg!(target_os = "linux") {
78+
run("sudo", &["apt", "install", "musl-tools"]);
79+
}
80+
7781
env::set_var("RUSTFLAGS", "-C target-feature=+crt-static");
7882
run("rustup", &["target", "add", target]);
7983
run(
@@ -95,32 +99,16 @@ fn build(target: &str) {
9599
.join("release")
96100
.join("kill_tree_cli")
97101
};
98-
let zip_path = format!("{target}.zip");
99-
let zip_file = std::fs::File::create(zip_path.clone()).unwrap();
100-
let mut zip = zip::ZipWriter::new(zip_file);
101-
let options = zip::write::FileOptions::default()
102-
.compression_method(zip::CompressionMethod::Stored)
103-
.unix_permissions(0o755);
104-
let file_name = file_path.file_name().unwrap().to_str().unwrap();
105-
zip.start_file(file_name, options).unwrap();
106-
let mut file = std::fs::File::open(file_path).unwrap();
107-
std::io::copy(&mut file, &mut zip).unwrap();
108-
zip.finish().unwrap();
109-
110102
let mut output_path = std::fs::OpenOptions::new()
111103
.write(true)
112104
.append(true)
113105
.open(output)
114106
.unwrap();
115-
writeln!(output_path, "ARTIFACT_PATH={zip_path}").unwrap();
107+
writeln!(output_path, "ARTIFACT_PATH={}", file_path.to_str().unwrap()).unwrap();
116108
}
117109
}
118110

119111
fn test(target: Option<String>) {
120-
if env::var("GITHUB_ACTIONS").is_ok() && cfg!(target_os = "linux") {
121-
run("sudo", &["apt", "install", "musl-tools"]);
122-
}
123-
124112
let Some(target) = target else {
125113
run("cargo", &["test", "--workspace"]);
126114
return;

0 commit comments

Comments
 (0)