-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.nu
32 lines (29 loc) · 929 Bytes
/
action.nu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
export-env {
if (sys host).name == "Darwin" {
$env.MACOSX_DEPLOYMENT_TARGET = "10.13"
}
if (sys host).name == "Windows" {
$env.RUSTFLAGS = "-C target-feature=+crt-static"
}
}
export def build [
...target: string
] {
let name = (open Cargo.toml).package.name
let version = (open Cargo.toml).package.version
for t in $target {
rustup target add $t
cargo build --release --target $t
match $t {
"aarch64-apple-darwin" | "x86_64-apple-darwin" | "x86_64-unknown-linux-gnu" => {
(tar
-C $"target/($t)/release"
-czvf $"target/($name)-($t)-($version).tar.gz"
$name)
}
"i686-pc-windows-msvc" | "x86_64-pc-windows-msvc" => {
mv $"target/($t)/release/($name).exe" $"target/($name)-($t)-($version).exe"
}
}
}
}