ci(cronet):check stable release

pull/1688/head
Xwite 3 years ago
parent 8f49c9fc07
commit c42c7f97ce
  1. 19
      .github/scripts/cronet.sh

@ -6,16 +6,13 @@ global_rematch() {
echo -e "usage: global_rematch <regex> <string> <debug flag>" echo -e "usage: global_rematch <regex> <string> <debug flag>"
else else
if [[ ! $s =~ $regex ]]; then if [[ ! $s =~ $regex ]]; then
[[ -n $debug ]] && echo -e "input string: $s"
[[ -n $debug ]] && echo -e "input regex: $regex"
echo -e "info: not matched!" echo -e "info: not matched!"
fi fi
while [[ $s =~ $regex ]]; do while [[ $s =~ $regex ]]; do
if [[ -n ${BASH_REMATCH[1]} ]];then if [[ -n ${BASH_REMATCH[1]} ]];then
[[ -n $debug ]] && echo "待匹配:$s" [[ -n $debug ]] && echo "${BASH_REMATCH[0]}"
echo "${BASH_REMATCH[1]}" echo "${BASH_REMATCH[1]}"
s=`echo $s | sed s/${BASH_REMATCH[1]}//g` s=`echo $s | sed s/${BASH_REMATCH[1]}//g`
[[ -n $debug ]] && echo "下次匹配:$s"
else else
echo -e "info: regex not has match group!" echo -e "info: regex not has match group!"
fi fi
@ -24,8 +21,18 @@ global_rematch() {
} }
echo "start download cronet info..." 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 ##beta version
# curl https://storage.googleapis.com/chromium-cronet/ -s > cronet
# global_rematch 'android.([0-9\.]+).Release.VERSION' "`cat cronet`" | tail -1 > lastest_cronet_version
##stable version
##fetch chrome stable release page
##https://chromereleases.googleblog.com/search/label/Stable%20updates
##match "released Chrome 98 (98.0.4758.101) for Android"
curl https://chromereleases.googleblog.com/search/label/Stable%20updates -s > stable_page
global_rematch 'released Chrome[ 0-9]+\(([0-9\.]+)\).{5}Android' "`cat stable_page`" | head -1 > lastest_cronet_version
lastest_cronet_version=`cat lastest_cronet_version` lastest_cronet_version=`cat lastest_cronet_version`
echo "lastest_cronet_version: $lastest_cronet_version" echo "lastest_cronet_version: $lastest_cronet_version"

Loading…
Cancel
Save