commit
1e8dec42b1
@ -0,0 +1,43 @@ |
||||
#bin/sh |
||||
|
||||
global_rematch() { |
||||
local s="$2" regex=$1 debug=$3 |
||||
if [[ -z "$1" || -z "$2" ]]; then |
||||
echo -e "usage: global_rematch <regex> <string> <debug flag>" |
||||
else |
||||
if [[ ! $s =~ $regex ]]; then |
||||
[[ -n $debug ]] && echo -e "input string: $s" |
||||
[[ -n $debug ]] && echo -e "input regex: $regex" |
||||
echo -e "info: not matched!" |
||||
fi |
||||
while [[ $s =~ $regex ]]; do |
||||
if [[ -n ${BASH_REMATCH[1]} ]];then |
||||
[[ -n $debug ]] && echo "待匹配:$s" |
||||
echo "${BASH_REMATCH[1]}" |
||||
s=`echo $s | sed s/${BASH_REMATCH[1]}//g` |
||||
[[ -n $debug ]] && echo "下次匹配:$s" |
||||
else |
||||
echo -e "info: regex not has match group!" |
||||
fi |
||||
done |
||||
fi |
||||
} |
||||
|
||||
echo "start download cronet info..." |
||||
curl https://storage.googleapis.com/chromium-cronet/ -s > cronet |
||||
global_rematch 'android.([0-9\.]+).Release.VERSION' "`cat cronet`" | tail -1 > lastest_cronet_version |
||||
lastest_cronet_version=`cat lastest_cronet_version` |
||||
echo "lastest_cronet_version: $lastest_cronet_version" |
||||
|
||||
path=$GITHUB_WORKSPACE/gradle.properties |
||||
current_cronet_version=`cat $path | grep CronetVersion | sed s/CronetVersion=//` |
||||
echo "current_cronet_version: $current_cronet_version" |
||||
|
||||
if [[ $current_cronet_version == $lastest_cronet_version ]];then |
||||
echo "cronet is already latest" |
||||
else |
||||
sed -i s/CronetVersion=.*/CronetVersion=$lastest_cronet_version/ $path |
||||
echo "start download latest cronet" |
||||
chmod +x gradlew |
||||
./gradlew app:downloadCronet |
||||
fi |
@ -1 +1 @@ |
||||
{"arm64-v8a":"690c212d9bbad4b09b9e1ba450b273bb","armeabi-v7a":"4dbb88e5229abef7d84138218772f872","x86":"3f2421e040147da48abb07cfc6c7c87e","x86_64":"730a71ef4f03a27d1c8c8a77e7d09ff5","version":"96.0.4664.104"} |
||||
{"x86":"9299ba13b7a4b89926a8fd1252acac24","armeabi-v7a":"f652ed38e2f23ba2a3e5484ef9369e78","x86_64":"76665854c4b927c87d82d09d9e726654","arm64-v8a":"96078052641b271fae90aa26ed1dbb45","version":"100.0.4847.0"} |
Loading…
Reference in new issue