From a5cf58936cb25511d3e173d7d70f7e656e99b163 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <61369261+fengyuecanzhu@users.noreply.github.com> Date: Sun, 20 Jun 2021 13:24:54 +0800 Subject: [PATCH 1/8] Create android.yml --- .github/workflows/android.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..abb3103 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,48 @@ +name: Android CI + +on: + release: + types: [published] + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: set up JDK 1.8 + uses: actions/setup-java@v2 + with: + java-version: '1.8' + distribution: 'adopt' + + # 获取打包秘钥 + - name: Checkout Android Keystore + uses: actions/checkout@v2 + with: + repository: 存储android打包用的key的仓库(格式:用户名/仓库名) + token: ${{ secrets.TOKEN }} # 连接仓库的token,需要单独配置 + path: keystore # 仓库的根目录名 + # 打包release + - name: Build with Gradle + run: bash ./gradlew assembleRelease + # 创建release + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ github.ref }} + release_name: FYReader_v${{ github.ref }} + draft: false + prerelease: false + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build From 4f401fe6f6864a6168dc5600f101b903835ddb49 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 20 Jun 2021 13:35:45 +0800 Subject: [PATCH 2/8] update --- .gitmodules | 3 ++ .idea/caches/build_file_checksums.ser | Bin 585 -> 0 bytes .idea/markdown-navigator-enh.xml | 10 +++++ .idea/markdown-navigator.xml | 62 ++++++++++++++++++++++++++ .idea/vcs.xml | 1 + app/build.gradle | 22 ++++++++- gradlew | 0 keystore | 1 + 8 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 .gitmodules delete mode 100644 .idea/caches/build_file_checksums.ser create mode 100644 .idea/markdown-navigator-enh.xml create mode 100644 .idea/markdown-navigator.xml mode change 100644 => 100755 gradlew create mode 160000 keystore diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..19dd4d8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "keystore"] + path = keystore + url = https://github.com/fengyuecanzhu/Key.git diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser deleted file mode 100644 index 5cd7f7f835355055cdbc1f400a68aca0a57c223f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 585 zcmZ4UmVvdnh`~NNKUXg?FQq6yGexf?KR>5fFEb@IQ7^qHF(oHeub?PDD>b=9F91S2 zm1gFoxMk*~I%lLNXBU^|7Q2L-Ts|(GuF1r}nf0c10SK=O;~lkaUMu4O+hGCKX^#l;c^ z5tq!woc#0%{UngTVY&+$>KNES8aB*-xA1<6`uC#;mDa8BU|mtdz=K_(=@gr9bGJqH zyb3sXMB&ZvIVB7NIr+(nIiTPzNG&SKOf4>jo7&Q`Jz<`8<>mTxxjQc^XJ(c#sOx9s z=cekXrRJqqmZs`M-Jy?&A`COG$oAaqXV}E@vVn8Pn;%YfB@BXiR8Lx1uQ;n{pUJhu kn<6j0T%!ndUSdH34o~l_dLwIo + + + + + + + + + \ No newline at end of file diff --git a/.idea/markdown-navigator.xml b/.idea/markdown-navigator.xml new file mode 100644 index 0000000..a2fc086 --- /dev/null +++ b/.idea/markdown-navigator.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..37b4af8 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index dbdf47a..9d9dfea 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -49,6 +49,14 @@ def getVersionName(){ def versionN = getVersionName() +// 读取keystore.properties +def keyProps = new Properties() +def keyPropsFile = rootProject.file('keystore/keystore.properties') +if (keyPropsFile.exists()) { + keyProps.load(new FileInputStream(keyPropsFile)) +} + + android { compileSdkVersion 29 buildToolsVersion '29.0.3' @@ -60,7 +68,16 @@ android { versionName versionN testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } - + + signingConfigs { + myConifg { + keyAlias keyProps['keyAlias'] + keyPassword keyProps['keyPassword'] + storeFile keyProps['storeFile'] ? file(keyProps['storeFile']) : null + storePassword keyProps['storePassword'] + } + } + buildFeatures { viewBinding true } @@ -72,12 +89,15 @@ android { ndk { abiFilters "x86", "armeabi", "armeabi-v7a" } + signingConfig signingConfigs.myConifg } debug { ndk { abiFilters "x86", "armeabi", "armeabi-v7a" } + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.myConifg } android.applicationVariants.all { variant -> variant.outputs.all { diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/keystore b/keystore new file mode 160000 index 0000000..d46d54c --- /dev/null +++ b/keystore @@ -0,0 +1 @@ +Subproject commit d46d54c2573c77713809f1061aef135c305bc9f4 From 61120904e2059fb88b4d84be8cc60578eaf9f3b2 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 20 Jun 2021 16:08:34 +0800 Subject: [PATCH 3/8] update actions --- .github/workflows/android.yml | 48 ----------------------------------- .github/workflows/reader.yml | 35 +++++++++++++++++++++++++ .gitmodules | 3 --- .idea/runConfigurations.xml | 10 ++++++++ .idea/vcs.xml | 1 - app/build.gradle | 8 ++++-- keystore | 1 - 7 files changed, 51 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/android.yml create mode 100644 .github/workflows/reader.yml delete mode 100644 .gitmodules create mode 100644 .idea/runConfigurations.xml delete mode 160000 keystore diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index abb3103..0000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Android CI - -on: - release: - types: [published] - push: - branches: - - master - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: set up JDK 1.8 - uses: actions/setup-java@v2 - with: - java-version: '1.8' - distribution: 'adopt' - - # 获取打包秘钥 - - name: Checkout Android Keystore - uses: actions/checkout@v2 - with: - repository: 存储android打包用的key的仓库(格式:用户名/仓库名) - token: ${{ secrets.TOKEN }} # 连接仓库的token,需要单独配置 - path: keystore # 仓库的根目录名 - # 打包release - - name: Build with Gradle - run: bash ./gradlew assembleRelease - # 创建release - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ github.ref }} - release_name: FYReader_v${{ github.ref }} - draft: false - prerelease: false - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml new file mode 100644 index 0000000..664e699 --- /dev/null +++ b/.github/workflows/reader.yml @@ -0,0 +1,35 @@ +name: Android CI + +on: + release: + types: [published] + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # 获取打包秘钥 + - name: Checkout Android Keystore + uses: actions/checkout@v2 + with: + repository: fengyuecanzhu/Key + token: ${{ secrets.KEY_TOKEN }} # 连接仓库的token,需要单独配置 + path: keystore # 仓库的根目录名 + # 打包release + - name: Build With Gradle + run: | + echo "开始进行release构建" + chmod +x gradlew + ./gradlew assembleAppRelease --parallel + - name: Upload App To Artifact + uses: actions/upload-artifact@v2 + with: + name: fyreader apk + path: ${{ github.workspace }}/app/build/outputs/apk/app/release/*.apk diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 19dd4d8..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "keystore"] - path = keystore - url = https://github.com/fengyuecanzhu/Key.git diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 37b4af8..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,5 @@ - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 9d9dfea..7f2ab15 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -89,7 +89,9 @@ android { ndk { abiFilters "x86", "armeabi", "armeabi-v7a" } - signingConfig signingConfigs.myConifg + if (keyPropsFile.exists()) { + signingConfig signingConfigs.myConifg + } } debug { ndk { @@ -97,7 +99,9 @@ android { } minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.myConifg + if (keyPropsFile.exists()) { + signingConfig signingConfigs.myConifg + } } android.applicationVariants.all { variant -> variant.outputs.all { diff --git a/keystore b/keystore deleted file mode 160000 index d46d54c..0000000 --- a/keystore +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d46d54c2573c77713809f1061aef135c305bc9f4 From 3ab6d8402c5396fb4c1b50cc82551bb86f69505c Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 20 Jun 2021 16:14:40 +0800 Subject: [PATCH 4/8] update actions --- .github/workflows/reader.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index 664e699..0574a2d 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -2,7 +2,7 @@ name: Android CI on: release: - types: [published] + types: [ published ] push: branches: - master @@ -14,21 +14,21 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - # 获取打包秘钥 - - name: Checkout Android Keystore - uses: actions/checkout@v2 - with: - repository: fengyuecanzhu/Key - token: ${{ secrets.KEY_TOKEN }} # 连接仓库的token,需要单独配置 - path: keystore # 仓库的根目录名 - # 打包release - - name: Build With Gradle + - uses: actions/checkout@v2 + # 获取打包秘钥 + - name: Checkout Android Keystore + uses: actions/checkout@v2 + with: + repository: fengyuecanzhu/Key + token: ${{ secrets.KEY_TOKEN }} # 连接仓库的token,需要单独配置 + path: keystore # 仓库的根目录名 + # 打包release + - name: Build With Gradle run: | echo "开始进行release构建" chmod +x gradlew - ./gradlew assembleAppRelease --parallel - - name: Upload App To Artifact + ./gradlew assembleAppRelease --build-cache --parallel + - name: Upload App To Artifact uses: actions/upload-artifact@v2 with: name: fyreader apk From 92531e95edee49ff6febff28f40e4a20daa88a96 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 20 Jun 2021 16:19:29 +0800 Subject: [PATCH 5/8] update actions --- .github/workflows/reader.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index 0574a2d..4aad8be 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -6,9 +6,6 @@ on: push: branches: - master - pull_request: - branches: - - master jobs: build: From 70f1ac4e95d8b8e0193a2b4851acc15502ccc64d Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 20 Jun 2021 16:22:53 +0800 Subject: [PATCH 6/8] update actions --- .github/workflows/reader.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index 4aad8be..4cf45bc 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -24,7 +24,7 @@ jobs: run: | echo "开始进行release构建" chmod +x gradlew - ./gradlew assembleAppRelease --build-cache --parallel + ./gradlew assembleRelease --parallel - name: Upload App To Artifact uses: actions/upload-artifact@v2 with: From 96b1a4c7a50a93719403d2adff1d7e4c688c9c1d Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 20 Jun 2021 16:38:12 +0800 Subject: [PATCH 7/8] update actions --- .github/workflows/reader.yml | 2 +- app/build.gradle | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index 4cf45bc..07efa05 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -29,4 +29,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: fyreader apk - path: ${{ github.workspace }}/app/build/outputs/apk/app/release/*.apk + path: ${{ github.workspace }}/app/release/*.apk diff --git a/app/build.gradle b/app/build.gradle index 7f2ab15..1af0fe6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -75,6 +75,8 @@ android { keyPassword keyProps['keyPassword'] storeFile keyProps['storeFile'] ? file(keyProps['storeFile']) : null storePassword keyProps['storePassword'] + v1SigningEnabled true + v2SigningEnabled true } } @@ -89,9 +91,9 @@ android { ndk { abiFilters "x86", "armeabi", "armeabi-v7a" } - if (keyPropsFile.exists()) { + //if (keyPropsFile.exists()) { signingConfig signingConfigs.myConifg - } + //} } debug { ndk { @@ -99,9 +101,9 @@ android { } minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - if (keyPropsFile.exists()) { + //if (keyPropsFile.exists()) { signingConfig signingConfigs.myConifg - } + //} } android.applicationVariants.all { variant -> variant.outputs.all { From e1d813802cb1cc94d8771e393722441171da77ad Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 20 Jun 2021 16:50:39 +0800 Subject: [PATCH 8/8] update actions --- .github/workflows/reader.yml | 2 +- app/build.gradle | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml index 07efa05..9466e50 100644 --- a/.github/workflows/reader.yml +++ b/.github/workflows/reader.yml @@ -29,4 +29,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: fyreader apk - path: ${{ github.workspace }}/app/release/*.apk + path: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk diff --git a/app/build.gradle b/app/build.gradle index 1af0fe6..f374557 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -91,9 +91,9 @@ android { ndk { abiFilters "x86", "armeabi", "armeabi-v7a" } - //if (keyPropsFile.exists()) { + if (keyPropsFile.exists()) { signingConfig signingConfigs.myConifg - //} + } } debug { ndk { @@ -101,9 +101,9 @@ android { } minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - //if (keyPropsFile.exists()) { + if (keyPropsFile.exists()) { signingConfig signingConfigs.myConifg - //} + } } android.applicationVariants.all { variant -> variant.outputs.all {