Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化打包编译脚本, 发布版本流程更简单一点. #224

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions utils/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/xege_libs
26 changes: 26 additions & 0 deletions utils/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

cd "$(dirname "$0")/.."
EGE_DIR=$(pwd)

cd utils

# 先执行一遍 release.sh
./release.sh

if [[ ! -d "xege_libs/.git" ]]; then
git clone [email protected]:wysaid/xege.org.git xege_libs
fi

if ! cd xege_libs; then
echo "Failed to enter xege_libs" >&2
exit 1
fi

git checkout master
git reset --hard origin/master
git pull

cp -rf "$EGE_DIR/Release/lib" .
cp -rf "$EGE_DIR/include" .
cp -rf "$EGE_DIR/man" .
43 changes: 39 additions & 4 deletions utils/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,30 @@ cd "$(dirname "$0")/.."

EGE_DIR=$(pwd)

if [[ $(uname -s) == "Darwin" ]] || [[ $(uname -s) == "Linux" ]]; then
git clean -ffdx build Release

declare -a FAILED_TASKS=()

if [[ $(uname -s) == "Darwin" ]]; then
# macos/linux
./tasks.sh --clean --release --load --target xege --build
mkdir -p Release/lib/macOS
cp -rf build/*.a Release/lib/macOS
if ./tasks.sh --clean --release --load --target xege --build; then
mkdir -p Release/lib/macOS
cp -rf build/*.a Release/lib/macOS
echo "Copy macOS libs done: $(pwd)/Release/lib/macOS"
else
echo "Build macOS failed!" >&2
FAILED_TASKS+=("macOS")
fi
elif [[ $(uname -s) == "Linux" ]]; then
if ./tasks.sh --clean --release --load --target xege --build; then
# 目前暂时只提供 mingw-w64-debian 的版本, 所以默认 mingw-w64-debian. 后续如果要支持更多, 那么再改.
mkdir -p Release/lib/mingw-w64-debian
cp -rf build/*.a Release/lib/mingw-w64-debian
echo "Copy mingw-w64-debian libs done: $(pwd)/Release/lib/mingw-w64-debian"
else
echo "Build mingw-w64-debian failed!" >&2
FAILED_TASKS+=("mingw-w64-debian")
fi
else
# vs2022 - 64bit
if ./tasks.sh --clean --release --toolset v143 --arch x64 --target xege --load --build; then
Expand All @@ -18,6 +37,7 @@ else
echo "Copy vs2022 x64 libs done: $(pwd)/Release/lib/vs2022/x64"
else
echo "Build vs2022 x64 failed!" >&2
FAILED_TASKS+=("vs2022 x64")
fi

# vs2022 - 32bit
Expand All @@ -28,6 +48,7 @@ else
echo "Copy vs2022 x86 libs done: $(pwd)/Release/lib/vs2022/x86"
else
echo "Build vs2022 x86 failed!" >&2
FAILED_TASKS+=("vs2022 x86")
fi

# vs2019 - 64bit
Expand All @@ -38,6 +59,7 @@ else
echo "Copy vs2019 x64 libs done: $(pwd)/Release/lib/vs2019/x64"
else
echo "Build vs2019 x64 failed!" >&2
FAILED_TASKS+=("vs2019 x64")
fi

# vs2019 - 32bit
Expand All @@ -48,6 +70,7 @@ else
echo "Copy vs2019 x86 libs done: $(pwd)/Release/lib/vs2019/x86"
else
echo "Build vs2019 x86 failed!" >&2
FAILED_TASKS+=("vs2019 x86")
fi

# vs2017 - 64bit
Expand All @@ -58,6 +81,7 @@ else
echo "Copy vs2017 x64 libs done: $(pwd)/Release/lib/vs2017/x64"
else
echo "Build vs2017 x64 failed!" >&2
FAILED_TASKS+=("vs2017 x64")
fi

# vs2017 - 32bit
Expand All @@ -68,6 +92,7 @@ else
echo "Copy vs2017 x86 libs done: $(pwd)/Release/lib/vs2017/x86"
else
echo "Build vs2017 x86 failed!" >&2
FAILED_TASKS+=("vs2017 x86")
fi

# vs2015 - 64bit
Expand All @@ -79,6 +104,7 @@ else
echo "Copy vs2015 x64 libs done: $(pwd)/Release/lib/vs2015/amd64"
else
echo "Build vs2015 x64 failed!" >&2
FAILED_TASKS+=("vs2015 x64")
fi

# vs2015 - 32bit
Expand All @@ -89,6 +115,7 @@ else
echo "Copy vs2015 x86 libs done: $(pwd)/Release/lib/vs2015"
else
echo "Build vs2015 x86 failed!" >&2
FAILED_TASKS+=("vs2015 x86")
fi

# vs2010 - 64bit
Expand All @@ -99,6 +126,7 @@ else
echo "Copy vs2010 x64 libs done: $(pwd)/Release/lib/vs2010/amd64"
else
echo "Build vs2010 x64 failed!" >&2
FAILED_TASKS+=("vs2010 x64")
fi

# vs2010 - 32bit
Expand All @@ -109,5 +137,12 @@ else
echo "Copy vs2010 x86 libs done: $(pwd)/Release/lib/vs2010"
else
echo "Build vs2010 x86 failed!" >&2
FAILED_TASKS+=("vs2010 x86")
fi
fi

if [[ ${#FAILED_TASKS[@]} -gt 0 ]]; then
echo "Failed tasks:" >&2
printf " %s\n" "${FAILED_TASKS[@]}" >&2
exit ${#FAILED_TASKS[@]}
fi
Loading