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