-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrelease_build.sh
More file actions
executable file
·62 lines (48 loc) · 1.56 KB
/
release_build.sh
File metadata and controls
executable file
·62 lines (48 loc) · 1.56 KB
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
#!/bin/zsh
set -e
DEVICE_TYPES=("nano_sp" "flex" "stax")
NETWORKS=("mainnet" "testnet")
typeset -A SDK_ENV_VARS
SDK_ENV_VARS["nano_sp"]="NANOSP_SDK"
SDK_ENV_VARS["flex"]="FLEX_SDK"
SDK_ENV_VARS["stax"]="STAX_SDK"
typeset -A COIN_NAME
COIN_NAME["mainnet"]="BBNST"
COIN_NAME["testnet"]="BBNST_test"
typeset -A OUTPUT_PATH
OUTPUT_PATH["mainnet"]="installer/apdu"
OUTPUT_PATH["testnet"]="installer/apdu-test"
mkdir -p bin installer/apdu installer/apdu-test
echo "starting..."
for network in "${NETWORKS[@]}"; do
echo ""
echo "===== construct $network ====="
for device in "${DEVICE_TYPES[@]}"; do
sdk_env="${SDK_ENV_VARS["$device"]}"
coin="${COIN_NAME["$network"]}"
echo "--> construct $device (env: $sdk_env) / coin: $coin"
docker exec -u 0 ledger-babylon-app-container bash -lc "\
pip install --break-system-packages --upgrade typing_extensions && \
git submodule update --init --recursive && \
export BOLOS_SDK=\$$sdk_env && \
make -C . -B -j DEBUG=0 COIN=$coin \
"
src_path="bin/app.apdu"
dest_path="${OUTPUT_PATH["$network"]}/${device}.apdu"
if [ -f "$src_path" ]; then
echo "cp $src_path to $dest_path"
cp "$src_path" "$dest_path"
else
echo "error: not found $src_path"
exit 1
fi
done
done
echo "✅ Firmware build finished. All .apdu files copied."
echo ""
echo "🚀 Step 2: Building installer..."
cd installer
./make_installer.sh
cd ..
echo ""
echo "✅ All steps completed successfully."