ci(cronet.sh):use chromiumdash.appspot.com to check release

pull/1695/head
Xwite 3 years ago
parent 7ad0bd3f93
commit e3a5f0c052
  1. 38
      .github/scripts/cronet.sh

@ -1,39 +1,9 @@
#bin/sh
echo "fetch release info from https://chromiumdash.appspot.com ..."
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
echo -e "info: not matched!"
fi
while [[ $s =~ $regex ]]; do
if [[ -n ${BASH_REMATCH[1]} ]];then
[[ -n $debug ]] && echo "${BASH_REMATCH[0]}"
echo "${BASH_REMATCH[1]}"
s=`echo $s | sed s/${BASH_REMATCH[1]}//g`
else
echo -e "info: regex not has match group!"
fi
done
fi
}
branch="Stable"
echo "start download cronet info..."
##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=`curl -s "https://chromiumdash.appspot.com/fetch_releases?channel=$branch&platform=Android&num=1&offset=0" | jq .[0].version -r`
echo "lastest_cronet_version: $lastest_cronet_version"
path=$GITHUB_WORKSPACE/gradle.properties
@ -49,5 +19,3 @@ else
chmod +x gradlew
./gradlew app:downloadCronet
fi
rm -f cronet lastest_cronet_version stable_page
Loading…
Cancel
Save