-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_for_release.sh
executable file
·45 lines (34 loc) · 1001 Bytes
/
build_for_release.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
#!/bin/bash
fnr() {
sed -i "s|$old|$new|g" Cargo.toml
}
build() {
# Ensure target directory is clean
rm -rf target/$target
# Disable dynamic linking for release builds
old='bevy = { version = "0.13.2" , features = \["dynamic_linking"\] }'
new='bevy = { version = "0.13.2" }'
fnr
cargo build --target=$target --release
# Enable dynamic linking for debug builds
old='bevy = { version = "0.13.2" }'
new='bevy = { version = "0.13.2" , features = \["dynamic_linking"\] }'
fnr
# Copy program into the builds directory
mkdir builds/$platform_name
cp target/$target/release/$program_name builds/$platform_name/
cp -r assets builds/$platform_name/
# Zip
cd builds
zip -r $platform_name.zip $platform_name
rm -r $platform_name
cd ..
}
target="x86_64-unknown-linux-gnu"
platform_name="linux"
program_name="hexen_havoc"
build
target="x86_64-pc-windows-gnu"
platform_name="windows"
program_name="hexen_havoc.exe"
build