-
Notifications
You must be signed in to change notification settings - Fork 1
/
daily.sh
executable file
·72 lines (51 loc) · 1.79 KB
/
daily.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
66
67
68
69
70
71
#!/bin/bash
set -e
#export RUSTUP_TOOLCHAIN=1.63
export BUILD_APPSCMD=yes
export OSX_CROSS=/home/capyloon/dev/capyloon/osx-cross
export SDKROOT=${OSX_CROSS}/MacOSX11.3.sdk
STRIP=${HOME}/.mozbuild/clang/bin/llvm-strip
function build_target() {
rm -rf prebuilts/
mkdir -p prebuilts/${TARGET_ARCH}
# Build sqlx-macros and its dependencies as a workspace level host crate.
cargo build --release --target=${TARGET_ARCH} -p sqlx-macros
pushd daemon
cargo build --release --target=${TARGET_ARCH}
popd
./release_libs.sh
cp target/${TARGET_ARCH}/release/api-daemon prebuilts/${TARGET_ARCH}/
${STRIP} prebuilts/${TARGET_ARCH}/api-daemon
pushd services/apps/appscmd
cargo build --release --target=${TARGET_ARCH}
popd
cp target/${TARGET_ARCH}/release/appscmd prebuilts/${TARGET_ARCH}/
${STRIP} prebuilts/${TARGET_ARCH}/appscmd
tar cJf api-daemon-${TARGET_ARCH}.tar.xz prebuilts
}
function apple_build() {
rm -rf prebuilts/
mkdir -p prebuilts/${TARGET_ARCH}
./update-prebuilts.sh
${OSX_CROSS}/cctools/bin/${TARGET_ARCH}-strip prebuilts/${TARGET_ARCH}/api-daemon
${OSX_CROSS}/cctools/bin/${TARGET_ARCH}-strip prebuilts/${TARGET_ARCH}/appscmd
tar cJf api-daemon-${TARGET_ARCH}.tar.xz prebuilts
}
# x86_64 desktop build
TARGET_ARCH=x86_64-unknown-linux-gnu
build_target
# Apple aarch64 build
export TARGET_ARCH=aarch64-apple-darwin
apple_build
# Apple x86_64 build
export TARGET_ARCH=x86_64-apple-darwin
apple_build
# Mobian aarch64 build
export MOZBUILD=$HOME/.mozbuild
export TARGET_ARCH=aarch64-unknown-linux-gnu
rm -rf prebuilts/
mkdir -p prebuilts/${TARGET_ARCH}
./update-prebuilts.sh
${STRIP} prebuilts/${TARGET_ARCH}/api-daemon
${STRIP} prebuilts/${TARGET_ARCH}/appscmd
tar cJf api-daemon-${TARGET_ARCH}.tar.xz prebuilts