Skip to content

Commit 8ac9db3

Browse files
committed
support verbose log
1 parent c357217 commit 8ac9db3

File tree

3 files changed

+59
-8
lines changed

3 files changed

+59
-8
lines changed

.github/workflows/all.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ on:
6363
options:
6464
- true
6565
- false
66+
verbose:
67+
description: 'print detail logs'
68+
required: false
69+
type: choice
70+
default: 'false'
71+
options:
72+
- true
73+
- false
6674
pull_request:
6775
branches: [master]
6876

@@ -88,7 +96,7 @@ jobs:
8896
8997
Platform=${{ inputs.platform }}
9098
DryRun=${{ inputs.dryrun }}
91-
99+
Verbose=${{ inputs.verbose }}
92100
compile_lib() {
93101
local lib_name=$1
94102
local platform=$Platform
@@ -116,7 +124,7 @@ jobs:
116124
echo "------compile $platform $lib_name------------------------------------"
117125
rm -rf build || git reset --hard || git pull origin
118126
.github/workflows/install-dependencies.sh $lib_name $platform # 补全依赖安装步骤
119-
.github/workflows/onestep.sh $lib_name $platform $DryRun
127+
.github/workflows/onestep.sh $lib_name $platform $DryRun $Verbose
120128
}
121129
122130
libs=(

.github/workflows/apple-android-common.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ on:
3535
options:
3636
- true
3737
- false
38+
verbose:
39+
description: 'print detail logs'
40+
required: false
41+
type: choice
42+
default: 'false'
43+
options:
44+
- true
45+
- false
3846
lib:
3947
description: 'choose a lib for compile'
4048
required: true
@@ -89,6 +97,6 @@ jobs:
8997
- name: Install dependencies
9098
run: .github/workflows/install-dependencies.sh ${{ inputs.lib }} ${{ inputs.platform }}
9199
- name: One Step
92-
run: .github/workflows/onestep.sh ${{ inputs.lib }} ${{ inputs.platform }} ${{ inputs.dryrun }}
100+
run: .github/workflows/onestep.sh ${{ inputs.lib }} ${{ inputs.platform }} ${{ inputs.dryrun }} ${{ inputs.verbose }}
93101
env:
94102
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

.github/workflows/onestep.sh

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ else
1515
export DRYRUN=
1616
fi
1717

18+
if [[ -n $4 && "$4" == 'true' ]];then
19+
export VERBOSE=1
20+
else
21+
export VERBOSE=
22+
fi
23+
1824
export HOMEBREW_NO_AUTO_UPDATE=1
1925
export RELEASE_DATE=$(TZ=UTC-8 date +'%y%m%d%H%M%S')
2026
export RELEASE_VERSION=$(grep GIT_REPO_VERSION= ./configs/libs/${LIB_NAME}.sh | tail -n 1 | awk -F = '{printf "%s",$2}')
@@ -40,8 +46,15 @@ function init_platform
4046
function compile_ios_platform
4147
{
4248
echo "---do compile ios libs--------------------------------------"
43-
./main.sh compile -p ios -c build -l ${LIB_NAME} --skip-fmwk >> $DIST_DIR/ios-compile-log-$RELEASE_VERSION.md
44-
49+
50+
local log_file="$DIST_DIR/ios-compile-log-$RELEASE_VERSION.md"
51+
52+
if [[ $VERBOSE ]];then
53+
./main.sh compile -p ios -c build -l ${LIB_NAME} --skip-fmwk 2>&1 | tee -a "$log_file"
54+
else
55+
./main.sh compile -p ios -c build -l ${LIB_NAME} --skip-fmwk >> "$log_file" 2>&1
56+
fi
57+
4558
cd build/product/ios/universal
4659
zip -ryq $DIST_DIR/${LIB_NAME}-ios-universal-${RELEASE_VERSION}.zip ./*
4760

@@ -53,8 +66,15 @@ function compile_ios_platform
5366
function compile_macos_platform
5467
{
5568
echo "---do compile macos libs--------------------------------------"
56-
./main.sh compile -p macos -c build -l ${LIB_NAME} --skip-fmwk >> $DIST_DIR/macos-compile-log-$RELEASE_VERSION.md
5769

70+
local log_file="$DIST_DIR/macos-compile-log-$RELEASE_VERSION.md"
71+
72+
if [[ $VERBOSE ]];then
73+
./main.sh compile -p macos -c build -l ${LIB_NAME} --skip-fmwk 2>&1 | tee -a "$log_file"
74+
else
75+
./main.sh compile -p macos -c build -l ${LIB_NAME} --skip-fmwk >> "$log_file" 2>&1
76+
fi
77+
5878
cd build/product/macos/universal
5979
zip -ryq $DIST_DIR/${LIB_NAME}-macos-universal-${RELEASE_VERSION}.zip ./*
6080
cd $ROOT_DIR
@@ -63,7 +83,14 @@ function compile_macos_platform
6383
function compile_tvos_platform
6484
{
6585
echo "---do compile tvos libs--------------------------------------"
66-
./main.sh compile -p tvos -c build -l ${LIB_NAME} --skip-fmwk >> $DIST_DIR/android-compile-log-$RELEASE_VERSION.md
86+
87+
local log_file="$DIST_DIR/android-compile-log-$RELEASE_VERSION.md"
88+
89+
if [[ $VERBOSE ]];then
90+
./main.sh compile -p tvos -c build -l ${LIB_NAME} --skip-fmwk 2>&1 | tee -a "$log_file"
91+
else
92+
./main.sh compile -p tvos -c build -l ${LIB_NAME} --skip-fmwk >> "$log_file" 2>&1
93+
fi
6794

6895
cd build/product/tvos/universal
6996
zip -ryq $DIST_DIR/${LIB_NAME}-tvos-universal-${RELEASE_VERSION}.zip ./*
@@ -77,7 +104,15 @@ function compile_tvos_platform
77104
function compile_android_platform
78105
{
79106
echo "---do compile android libs--------------------------------------"
80-
./main.sh compile -p android -c build -l ${LIB_NAME} #>> $DIST_DIR/android-compile-log-$RELEASE_VERSION.md
107+
108+
local log_file="$DIST_DIR/android-compile-log-$RELEASE_VERSION.md"
109+
110+
if [[ $VERBOSE ]];then
111+
./main.sh compile -p android -c build -l ${LIB_NAME} 2>&1 | tee -a "$log_file"
112+
else
113+
./main.sh compile -p android -c build -l ${LIB_NAME} >> "$log_file" 2>&1
114+
fi
115+
81116
cd build/product/android/universal
82117
zip -ryq $DIST_DIR/${LIB_NAME}-android-universal-${RELEASE_VERSION}.zip ./*
83118
cd $ROOT_DIR

0 commit comments

Comments
 (0)