-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcompile.sh
executable file
·29 lines (22 loc) · 1.1 KB
/
compile.sh
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
#!/usr/bin/env bash
set -ueo pipefail
docker info > /dev/null
VERSION="$(git describe --tags --abbrev=8)"
# TARGETS=(aarch64-apple-darwin x86_64-apple-darwin x86_64-unknown-linux-musl)
TARGETS=(aarch64-apple-darwin x86_64-apple-darwin)
build_cross() {
for target in "${TARGETS[@]}"; do
cross build --target "$target" --release
tar czf "darkroom-${VERSION}-${target}.tar.gz" -C "./target/${target}/release" dark
cross build --target "$target" --release --no-default-features
tar czf "darkroom-${VERSION}-no-default-features-${target}.tar.gz" -C "./target/${target}/release" dark
done
}
build_linux() {
local target="x86_64-unknown-linux-musl"
docker run --platform linux/amd64 --rm -it -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder cargo build --release
tar czf "darkroom-${VERSION}-${target}.tar.gz" -C "./target/${target}/release" dark
docker run --platform linux/amd64 --rm -it -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder cargo build --release --no-default-features
tar czf "darkroom-${VERSION}-no-default-features-${target}.tar.gz" -C "./target/${target}/release" dark
}
$1