54 lines
1.5 KiB
Bash
54 lines
1.5 KiB
Bash
##!/bin/bash
|
||
SHELL_DIR=$(dirname $0)
|
||
echo "change dir to $SHELL_DIR"
|
||
cd "$SHELL_DIR"
|
||
|
||
# Source the local environment
|
||
if [ -f ./local_env.sh ]; then
|
||
source ./local_env.sh
|
||
echo "found the local_env file"
|
||
fi
|
||
|
||
# Set the target platform (e.g., Android, iOS, Windows, etc.)
|
||
PLATFORM="Android"
|
||
#PLATFORM="iOS"
|
||
|
||
# Set if needs to clear cache
|
||
CLEARCACHED="yes"
|
||
#CLEARCACHED="no"
|
||
|
||
#Set build Addressables groups (modify as needed)
|
||
ADDRESSABLES_GROUPS="Level"
|
||
|
||
EXECUTE_METHOD="BatchBuild.BuildAddressables"
|
||
LOG_FILE="$PROJECT_BUILD_FOLDER/$PLATFORM/$VERSION/buildResource.log"
|
||
|
||
# Set the URL where you want to send the message
|
||
NOTE_URL="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3c92758c-1128-4931-ac8d-f19669d7befe"
|
||
|
||
echo "Start building Addressables groups [$ADDRESSABLES_GROUPS]... ..."
|
||
|
||
# Execute Unity build command
|
||
"$UNITY_PATH" -quit -batchmode -projectPath "$PROJECT_PATH" -executeMethod "$EXECUTE_METHOD" \
|
||
-platform "$PLATFORM" \
|
||
-profile Debug \
|
||
-clearCached "$CLEARCACHED" \
|
||
-groups "$ADDRESSABLES_GROUPS" \
|
||
-logFile "$LOG_FILE"
|
||
|
||
build_result=$?
|
||
|
||
if [ $build_result -ne 0 ]; then
|
||
echo "GROUPS: [$ADDRESSABLES_GROUPS] build failed. Check the log for details."
|
||
sh to_inner_wechat_robot.sh " ADDRESSABLES GROUPS: [$ADDRESSABLES_GROUPS] 构建失败, 错误码【"$build_result"】,详情查看工作机器上的Log"
|
||
exit 1
|
||
|
||
else
|
||
echo "GROUPS: [$ADDRESSABLES_GROUPS] build successful."
|
||
fi
|
||
|
||
#sh to_inner_wechat_robot.sh "$MESSAGE"
|
||
|
||
# upload remote resource to server
|
||
#sh upload_to_server.sh "$PLATFORM" "$VERSION"
|