diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index bac91a7bea..fdfd406c7f 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: inputs: version: - description: 'Version' + description: 'Version (without "v" prefix)' required: true type: string @@ -41,17 +41,34 @@ jobs: mkdir -p ~/.gradle cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties - - name: Build app + # PROD + - name: Prepare release build + if: github.event.inputs.version != '' + run: | + set -x + echo "VERSION_TAG=v${{github.event.inputs.version}}" >> $GITHUB_ENV + + # NIGHTLY + - name: Prepare nightly build + if: github.event.inputs.version == '' + run: | + set -x + echo "VERSION_TAG=r$(git rev-list --count HEAD)" >> $GITHUB_ENV + echo "PREV_TAG=$(git tag -l | grep 'r' | tail -1)" >> $GITHUB_ENV + + # PROD + - name: Build release build + if: startsWith(env.VERSION_TAG, 'v') uses: gradle/gradle-command-action@v2 with: arguments: assembleStandardRelease - # Sign APK and create release for tags - - name: Get tag name - if: github.event.inputs.version != '' - run: | - set -x - echo "VERSION_TAG=${{github.event.inputs.version}}" >> $GITHUB_ENV + # NIGHTLY + - name: Build nightly build + if: startsWith(env.VERSION_TAG, 'r') + uses: gradle/gradle-command-action@v2 + with: + arguments: assembleStandardNightly - name: Sign APK if: env.VERSION_TAG != '' @@ -89,7 +106,7 @@ jobs: echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV - name: Create Release - if: env.VERSION_TAG != '' + if: startsWith(env.VERSION_TAG, 'v') uses: softprops/action-gh-release@v1 with: tag_name: ${{ env.VERSION_TAG }} @@ -116,3 +133,38 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Delete Old Nightly + if: startsWith(env.VERSION_TAG, 'r') && env.PREV_TAG != '' + run: gh release delete ${{ env.PREV_TAG }} --cleanup-tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Nightly + if: startsWith(env.VERSION_TAG, 'r') + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.VERSION_TAG }} + name: Yōkai ${{ env.VERSION_TAG }} + body: | + ### Disclaimer: + ***This alpha version is for testing only.*** + It is not ready for daily use and we do not guarantee its usability. + + Please backup your data before using it! + + --- + + ### Checksums + + | Variant | SHA-256 | + | ------- | ------- | + | Universal | ${{ env.APK_UNIVERSAL_SHA }} + | arm64-v8a | ${{ env.APK_ARM64_V8A_SHA }} + | armeabi-v7a | ${{ env.APK_ARMEABI_V7A_SHA }} + | x86 | ${{ env.APK_X86_SHA }} | + | x86_64 | ${{ env.APK_X86_64_SHA }} | + draft: false + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5abc2c2878..58b83781ae 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -77,6 +77,15 @@ android { isMinifyEnabled = true proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro") } + create("nightly") { + initWith(getByName("release")) + buildConfigField("boolean", "BETA", "true") + + signingConfig = signingConfigs.getByName("debug") + matchingFallbacks.add("release") + versionNameSuffix = "-b${getCommitCount()}" + applicationIdSuffix = ".nightlyYokai" + } } buildFeatures { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt index ab9520bb9b..eff081ecf7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt @@ -93,7 +93,7 @@ class AboutController : SettingsController() { preference { key = "pref_version" titleRes = R.string.version - summary = if (BuildConfig.DEBUG) { + summary = if (BuildConfig.DEBUG || BuildConfig.BETA) { "r" + BuildConfig.COMMIT_COUNT } else { BuildConfig.VERSION_NAME diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/debug/DebugController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/debug/DebugController.kt index ec0db8a797..a60b84d9fd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/debug/DebugController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/debug/DebugController.kt @@ -40,7 +40,7 @@ class DebugController : SettingsController() { preference { key = "pref_version" title = "Version" - summary = if (BuildConfig.DEBUG) { + summary = if (BuildConfig.DEBUG || BuildConfig.BETA) { "r" + BuildConfig.COMMIT_COUNT } else { BuildConfig.VERSION_NAME diff --git a/app/src/standard/google-services.json b/app/src/standard/google-services.json index 75fec0bfb7..ab0d24323b 100644 --- a/app/src/standard/google-services.json +++ b/app/src/standard/google-services.json @@ -24,6 +24,25 @@ } } }, + { + "client_info": { + "mobilesdk_app_id": "1:636318130901:android:388d6d443528368657f85c", + "android_client_info": { + "package_name": "eu.kanade.tachiyomi.nightlyYokai" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBORypbgpIKGb8s3Si6gaQlY5CLkR804OI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, { "client_info": { "mobilesdk_app_id": "1:636318130901:android:0ae2cb126b21d3a357f85c",