From e82329d1386d5ed35324f3f54271aea79676fb29 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Mon, 21 Jun 2021 19:01:09 +0800 Subject: [PATCH] update actions --- .github/workflows/reader.yml | 88 +++++++++++-------- app/src/main/assets/updatelog.fy | 1 + .../xyz/fycz/myreader/util/utils/AdUtils.java | 8 +- 3 files changed, 55 insertions(+), 42 deletions(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index 2176cb5..9d346d2 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -21,44 +21,51 @@ jobs: repository: fengyuecanzhu/Key token: ${{ secrets.KEY_TOKEN }} # 连接仓库的token,需要单独配置 path: keystore # 仓库的根目录名 - # 打包release - - name: Build With Gradle - run: | - echo "开始进行release构建" - chmod +x gradlew - ./gradlew assembleRelease --parallel - - name: Upload App To Artifact - uses: actions/upload-artifact@v2 - with: - name: FYReader-apk - path: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk + # 读取配置 - name: Prepare Config - id: config - run: | - echo "获取是否需要创建release并获取配置" - source ${{ github.workspace }}/app/version_code.properties - version=$VERSION_CODE - hun=$(expr ${version} / 100) - ten=$(expr ${version} / 10) - ten=$(expr ${ten} % 10) - one=$(expr ${version} % 10) - versionN=$hun.$ten.$one + id: config + run: | + echo "读取配置" + source ${{ github.workspace }}/app/version_code.properties + version=$VERSION_CODE + hun=$(expr ${version} / 100) + ten=$(expr ${version} / 10) + ten=$(expr ${ten} % 10) + one=$(expr ${version} % 10) + versionN=v$hun.$ten.$one - echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE" - echo ::set-output name=version_name::"$versionN" + echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE" + echo ::set-output name=version_name::"$versionN" - echo need_create_release=$NEED_CREATE_RELEASE - echo version_name=v$versionN + echo need_create_release=$NEED_CREATE_RELEASE + echo version_name=$versionN - if [[ $NEED_CREATE_RELEASE == 'true' ]];then - echo ::set-output name=lanzou_folder_id::"1608604" - echo ::set-output name=lanzou_share_url::"https://fycz.lanzoui.com/b00ngso7e" + if [[ $NEED_CREATE_RELEASE == 'true' ]];then + echo ::set-output name=lanzou_folder_id::"1608604" + echo ::set-output name=lanzou_share_url::"https://fycz.lanzoui.com/b00ngso7e" + else + echo ::set-output name=lanzou_folder_id::"2226473" + echo ::set-output name=lanzou_share_url::"https://fycz.lanzoui.com/b00nu1f8d" + fi + # 编译打包 + - name: Build With Gradle + run: | + echo "开始编译打包" + chmod +x gradlew + if [[ ${{ steps.config.outputs.need_create_release }} == 'true' ]];then + echo "进行release构建" + ./gradlew assembleRelease --parallel else - echo ::set-output name=lanzou_folder_id::"2226473" - echo ::set-output name=lanzou_share_url::"https://fycz.lanzoui.com/b00nu1f8d" + echo "进行Debug构建" + ./gradlew assembleDebug --parallel fi - + - name: Get File Path + id: get_path + run: | path="$GITHUB_WORKSPACE/app/build/outputs/apk/release" + if [[ ${{ steps.config.outputs.need_create_release }} != 'true' ]];then + path="$GITHUB_WORKSPACE/app/build/outputs/apk/debug" + fi files=$(ls $path) for f in $files do @@ -70,6 +77,16 @@ jobs: done echo ::set-output name=file_name::"$file" echo ::set-output name=file_path::"$path/$file" + - name: Upload App To Artifact + uses: actions/upload-artifact@v2 + with: + name: FYReader-apk + path: ${{ steps.get_path.outputs.file_path }} + - name: Upload App To Lanzou + if: ${{ env.ylogin }} + run: | + python3 $GITHUB_WORKSPACE/.github/scripts/lzy.py "${{ steps.get_path.outputs.file_path }}" "${{ steps.config.outputs.lanzou_folder_id }}" + echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: ${{ steps.config.outputs.lanzou_share_url }}" - name: Create Release id: create_release if: ${{ steps.config.outputs.need_create_release == 'true' }} @@ -90,11 +107,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.config.outputs.file_path }} + asset_path: ${{ steps.get_path.outputs.file_path }} asset_name: FYReader_${{ steps.config.outputs.version_name }}.apk - asset_content_type: application/vnd.android.package-archive - - name: Upload App To Lanzou - if: ${{ env.ylogin }} - run: | - python3 $GITHUB_WORKSPACE/.github/scripts/lzy.py "${{ steps.config.outputs.file_path }}" "${{ steps.config.outputs.lanzou_folder_id }}" - echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: ${{ steps.config.outputs.lanzou_share_url }}" + asset_content_type: application/vnd.android.package-archive \ No newline at end of file diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index 85c2bde..6c18f2b 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,3 +1,4 @@ +2021.06.21 风月读书v2.1.4 更新内容: 1、搜索新增关键词推荐补全 diff --git a/app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java b/app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java index ea72a67..8aab375 100644 --- a/app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java +++ b/app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java @@ -123,10 +123,10 @@ public class AdUtils { public static void initAd() { if (!hasInitAd) { hasInitAd = true; - DdSdkHelper.init("", "", "", - "", "", - "", "", - App.getApplication(), true); + DdSdkHelper.init("1234", "216", "51716a16fbdf50905704b6575b1b3b60", + "142364", "35ce0efe5f3cc960b116db227498e238", + "8167", "85bd159309c3da1b", + App.getApplication(), App.isDebug()); } } }