diff --git a/.github/scripts/cronet.sh b/.github/scripts/cronet.sh index 35b8fbd5a..19d5a3524 100644 --- a/.github/scripts/cronet.sh +++ b/.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 " - 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 \ No newline at end of file diff --git a/.github/workflows/cronet.yml b/.github/workflows/cronet.yml index 5dcdb8adf..d1b93dc02 100644 --- a/.github/workflows/cronet.yml +++ b/.github/workflows/cronet.yml @@ -8,17 +8,18 @@ on: jobs: build: runs-on: ubuntu-latest + if: ${{ github.actor == 'gedoor' }} steps: - uses: actions/checkout@v2 with: fetch-depth: 1 - - name: Download Lastest Cronet jar + - name: Check Cronet Updates run: | echo "获取cronet最新版本" source .github/scripts/cronet.sh - echo "PR_TITLE=Bump cronet from $current_cronet_version to $lastest_cronet_version " >>$GITHUB_ENV - echo "PR_BODY=Changes in the [Git log](https://chromium.googlesource.com/chromium/src/+log/$current_cronet_version..$lastest_cronet_version)" >>$GITHUB_ENV + echo "PR_TITLE=Bump cronet from $current_cronet_version to $lastest_cronet_version " >> $GITHUB_ENV + echo "PR_BODY=Changes in the [Git log](https://chromium.googlesource.com/chromium/src/+log/$current_cronet_version..$lastest_cronet_version)" >> $GITHUB_ENV - name: Create Pull Request uses: peter-evans/create-pull-request@v3 diff --git a/app/src/main/assets/cronet.json b/app/src/main/assets/cronet.json index ee32e5aad..4f092f02f 100644 --- a/app/src/main/assets/cronet.json +++ b/app/src/main/assets/cronet.json @@ -1 +1 @@ -{"arm64-v8a":"df27e27ee769fd817c1ad6f2f6378abd","armeabi-v7a":"c4746896e8f23a88098655779ee9caa5","x86":"9b3028a8d79cc3646ba20f51fc0ea175","x86_64":"845c50a84451ee9a92bb6ac223e2554b","version":"99.0.4844.58"} \ No newline at end of file +{"x86":"9b3028a8d79cc3646ba20f51fc0ea175","armeabi-v7a":"c4746896e8f23a88098655779ee9caa5","x86_64":"845c50a84451ee9a92bb6ac223e2554b","arm64-v8a":"df27e27ee769fd817c1ad6f2f6378abd","version":"99.0.4844.58"} \ No newline at end of file diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index c7ee134cb..f60d38633 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -13,6 +13,7 @@ **2022/03/07** +* 更新cronet: 99.0.4844.58 * 导入本地书籍界面添加排序功能 * 修复txt最后一句不显示的bug * pro版本可以单独设置启动画面