diff --git a/.github/workflows/reader.yml b/.github/workflows/reader.yml new file mode 100644 index 0000000..9466e50 --- /dev/null +++ b/.github/workflows/reader.yml @@ -0,0 +1,32 @@ +name: Android CI + +on: + release: + types: [ published ] + push: + 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 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 diff --git a/.idea/markdown-navigator-enh.xml b/.idea/markdown-navigator-enh.xml new file mode 100644 index 0000000..a8fcc84 --- /dev/null +++ b/.idea/markdown-navigator-enh.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ 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/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/app/build.gradle b/app/build.gradle index dbdf47a..f374557 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,18 @@ 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'] + v1SigningEnabled true + v2SigningEnabled true + } + } + buildFeatures { viewBinding true } @@ -72,12 +91,19 @@ android { ndk { abiFilters "x86", "armeabi", "armeabi-v7a" } + if (keyPropsFile.exists()) { + signingConfig signingConfigs.myConifg + } } debug { ndk { abiFilters "x86", "armeabi", "armeabi-v7a" } + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + if (keyPropsFile.exists()) { + signingConfig signingConfigs.myConifg + } } android.applicationVariants.all { variant -> variant.outputs.all { diff --git a/gradlew b/gradlew old mode 100644 new mode 100755