diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 4deea456..e83b0752 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -28,6 +28,12 @@ jobs: path: | app/libs/core-release.aar key: ${{ hashFiles('core_status') }} + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -54,6 +60,12 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: go-version: 1.16 + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -80,6 +92,12 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: go-version: 1.16 + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -107,6 +125,12 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: go-version: 1.16 + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -132,6 +156,12 @@ jobs: - name: Install Rust if: steps.cache.outputs.cache-hit != 'true' run: ./run init action shadowsocks + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -153,6 +183,12 @@ jobs: path: | app/libs/shadowsocksr-release.aar key: ${{ hashFiles('shadowsocksr_status') }} + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c53a61c6..94c949d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,12 @@ jobs: path: | app/libs/core-release.aar key: ${{ hashFiles('core_status') }} + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -65,6 +71,12 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: go-version: 1.16 + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -90,6 +102,12 @@ jobs: - name: Install Rust if: steps.cache.outputs.cache-hit != 'true' run: ./run init action shadowsocks + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | @@ -112,6 +130,12 @@ jobs: path: | app/libs/shadowsocksr-release.aar key: ${{ hashFiles('shadowsocksr_status') }} + - name: Gradle cache + uses: actions/cache@v2 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: ~/.gradle + key: native-${{ hashFiles('**/*.gradle') }} - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: | diff --git a/app/build.gradle b/app/build.gradle index 72e53533..e6802aff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,13 +6,16 @@ plugins { id "com.mikepenz.aboutlibraries.plugin" } -def verCode = 27 -def verName = "0.1-beta26" +def metadata = new Properties() +metadata.load(project.rootProject.file("sager.properties").newDataInputStream()) + +def verCode = metadata.getProperty("VERSION_CODE").toInteger() +def verName = metadata.getProperty("VERSION_NAME") +def packageName = metadata.getProperty("PACKAGE_NAME") def keystorePwd = null def alias = null def pwd = null -def packageName = null Properties properties def base64 = System.getenv("LOCAL_PROPERTIES") @@ -28,7 +31,6 @@ if (properties != null) { keystorePwd = properties.getProperty("KEYSTORE_PASS") alias = properties.getProperty("ALIAS_NAME") pwd = properties.getProperty("ALIAS_PASS") - packageName = properties.getProperty("PACKAGE_NAME") } keystorePwd = keystorePwd ?: System.getenv("KEYSTORE_PASS") @@ -62,7 +64,7 @@ android { buildToolsVersion "30.0.3" defaultConfig { - applicationId packageName == null ? "io.nekohasekai.sagernet" : packageName + applicationId packageName minSdkVersion 21 targetSdkVersion 30 versionCode verCode diff --git a/sager.properties b/sager.properties new file mode 100644 index 00000000..0be1d109 --- /dev/null +++ b/sager.properties @@ -0,0 +1,22 @@ +# +# +# Copyright (C) 2021 by nekohasekai +# Copyright (C) 2021 by Max Lv +# Copyright (C) 2021 by Mygod Studio +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +PACKAGE_NAME=io.nekohasekai.sagernet +VERSION_NAME=0.1-beta26 +VERSION_CODE=27 \ No newline at end of file