-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·65 lines (55 loc) · 2.05 KB
/
build.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Get directory of this file.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Move to this file's directory.
cd $SCRIPT_DIR &&
# Make release directory.
mkdir -p release &&
# Remove files from release directory.
rm -rf release/* &&
# Build 64-bit macOS (10.7+, Lion+).
rustup target add x86_64-apple-darwin &&
cargo build \
--release \
--target=x86_64-apple-darwin &&
cp \
target/x86_64-apple-darwin/release/encoder \
release/encoder_x86_64-apple-darwin &&
# Build 32-bit, 64-bit GNU and 64-bit MUSL for Linux.
docker run \
--rm \
--user "$(id -u)":"$(id -g)" \
-v "$PWD":/usr/src/myapp \
-w /usr/src/myapp \
-t \
ghcr.io/santerihetekivi/rust-multilib:master \
./build-linux-gnu.sh &&
cp \
target/i686-unknown-linux-gnu/release/encoder \
release/encoder_i686-unknown-linux-gnu &&
cp \
target/x86_64-unknown-linux-gnu/release/encoder \
release/encoder_x86_64-unknown-linux-gnu &&
cp \
target/x86_64-unknown-linux-musl/release/encoder \
release/encoder_x86_64-unknown-linux-musl &&
# Build ARM64 Linux (kernel 4.2, glibc 2.17+).
#cargo build --release --target=aarch64-unknown-linux-gnu &&
#cp target/release/encoder release/encoder_aarch64-unknown-linux-gnu &&
# Build 32-bit MinGW (Windows 7+).
#rustup target add i686-pc-windows-gnu &&
#cargo build --release --target=i686-pc-windows-gnu &&
#cp target/release/encoder release/encoder_i686-pc-windows-gnu &&
# Build 32-bit MSVC (Windows 7+).
#rustup target add i686-pc-windows-msvc &&
#cargo build --release --target=i686-pc-windows-msvc &&
#cp target/release/encoder release/encoder_i686-pc-windows-msvc &&
# Build 64-bit MinGW (Windows 7+).
#rustup target add x86_64-pc-windows-gnu &&
#cargo build --release --target=x86_64-pc-windows-gnu &&
#cp target/release/encoder release/encoder_x86_64-pc-windows-gnu &&
# Build 64-bit MSVC (Windows 7+).
#rustup target add x86_64-pc-windows-msvc &&
#cargo build --release --target=x86_64-pc-windows-msvc &&
#cp target/release/encoder release/encoder_x86_64-pc-windows-msvc &&
echo "Done"