Enable split apk generation (#717)
This commit is contained in:
parent
4368167518
commit
584ddbee6a
@ -1,83 +0,0 @@
|
|||||||
name: Release Builder
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'release'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check_wrapper:
|
|
||||||
name: Validate Gradle Wrapper
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
|
||||||
uses: gradle/wrapper-validation-action@v1
|
|
||||||
|
|
||||||
build:
|
|
||||||
name: Build app
|
|
||||||
needs: check_wrapper
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Cancel previous runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.5.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Clone repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up JDK 11
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
java-version: 11
|
|
||||||
distribution: adopt
|
|
||||||
|
|
||||||
- name: Write google-services.json
|
|
||||||
uses: DamianReeves/write-file-action@v1.0
|
|
||||||
with:
|
|
||||||
# The path to the file to write
|
|
||||||
path: app/google-services.json
|
|
||||||
# The contents of the file
|
|
||||||
contents: ${{ secrets.GOOGLE_SERVICES_TEXT }}
|
|
||||||
# The mode of writing to use: `overwrite`, `append`, or `preserve`.
|
|
||||||
write-mode: overwrite # optional, default is preserve
|
|
||||||
|
|
||||||
- name: Build app
|
|
||||||
uses: gradle/gradle-command-action@v2
|
|
||||||
with:
|
|
||||||
arguments: assembleStandardRelease --stacktrace
|
|
||||||
|
|
||||||
- name: Sign APK
|
|
||||||
uses: r0adkll/sign-android-release@v1
|
|
||||||
with:
|
|
||||||
releaseDirectory: app/build/outputs/apk/standard/release
|
|
||||||
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
|
||||||
alias: ${{ secrets.ALIAS }}
|
|
||||||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
||||||
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.run_number }}
|
|
||||||
release_name: TachiyomiSY
|
|
||||||
draft: true
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
- name: Upload APK to release
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ${{ env.SIGNED_RELEASE_FILE }}
|
|
||||||
asset_name: TachiyomiSY.apk
|
|
||||||
asset_content_type: application/vnd.android.package-archive
|
|
102
.github/workflows/build_push.yml
vendored
Normal file
102
.github/workflows/build_push.yml
vendored
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
name: Release Builder
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'release'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build release app
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Validate Gradle Wrapper
|
||||||
|
uses: gradle/wrapper-validation-action@v1
|
||||||
|
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
distribution: adopt
|
||||||
|
|
||||||
|
# SY <--
|
||||||
|
- name: Write google-services.json
|
||||||
|
uses: DamianReeves/write-file-action@v1.0
|
||||||
|
with:
|
||||||
|
path: app/google-services.json
|
||||||
|
contents: ${{ secrets.GOOGLE_SERVICES_TEXT }}
|
||||||
|
write-mode: overwrite
|
||||||
|
# SY -->
|
||||||
|
|
||||||
|
- name: Build app and run unit tests
|
||||||
|
uses: gradle/gradle-command-action@v2
|
||||||
|
with:
|
||||||
|
arguments: assembleStandardRelease testStandardReleaseUnitTest --stacktrace
|
||||||
|
|
||||||
|
- name: Sign APK
|
||||||
|
uses: r0adkll/sign-android-release@v1
|
||||||
|
with:
|
||||||
|
releaseDirectory: app/build/outputs/apk/standard/release
|
||||||
|
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
||||||
|
alias: ${{ secrets.ALIAS }}
|
||||||
|
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
||||||
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Clean up build artifacts
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
mv app/build/outputs/apk/standard/release/app-standard-universal-release-unsigned-signed.apk TachiyomiSY.apk
|
||||||
|
sha=`sha256sum TachiyomiSY.apk | awk '{ print $1 }'`
|
||||||
|
echo "APK_UNIVERSAL_SHA=$sha" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
cp app/build/outputs/apk/standard/release/app-standard-arm64-v8a-release-unsigned-signed.apk TachiyomiSY-arm64-v8a.apk
|
||||||
|
sha=`sha256sum TachiyomiSY-arm64-v8a.apk | awk '{ print $1 }'`
|
||||||
|
echo "APK_ARM64_V8A_SHA=$sha" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
cp app/build/outputs/apk/standard/release/app-standard-armeabi-v7a-release-unsigned-signed.apk TachiyomiSY-armeabi-v7a.apk
|
||||||
|
sha=`sha256sum TachiyomiSY-armeabi-v7a.apk | awk '{ print $1 }'`
|
||||||
|
echo "APK_ARMEABI_V7A_SHA=$sha" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
cp app/build/outputs/apk/standard/release/app-standard-x86-release-unsigned-signed.apk TachiyomiSY-x86.apk
|
||||||
|
sha=`sha256sum TachiyomiSY-x86.apk | awk '{ print $1 }'`
|
||||||
|
echo "APK_X86_SHA=$sha" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
cp app/build/outputs/apk/standard/release/app-standard-x86_64-release-unsigned-signed.apk TachiyomiSY-x86_64.apk
|
||||||
|
sha=`sha256sum TachiyomiSY-x86_64.apk | awk '{ print $1 }'`
|
||||||
|
echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.run_number }}
|
||||||
|
name: TachiyomiSY
|
||||||
|
body: |
|
||||||
|
---
|
||||||
|
|
||||||
|
### 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 }} |
|
||||||
|
files: |
|
||||||
|
TachiyomiSY.apk
|
||||||
|
TachiyomiSY-arm64-v8a.apk
|
||||||
|
TachiyomiSY-armeabi-v7a.apk
|
||||||
|
TachiyomiSY-x86.apk
|
||||||
|
TachiyomiSY-x86_64.apk
|
||||||
|
draft: true
|
||||||
|
prerelease: false
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@ -6,8 +6,9 @@ on:
|
|||||||
- 'master'
|
- 'master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_wrapper:
|
trigger_preview_build:
|
||||||
name: Validate Gradle Wrapper
|
name: Trigger preview build
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -17,15 +18,6 @@ jobs:
|
|||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v1
|
||||||
|
|
||||||
preview:
|
|
||||||
name: Build app preview
|
|
||||||
needs: check_wrapper
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: TAG - Bump version and push tag
|
- name: TAG - Bump version and push tag
|
||||||
uses: anothrNick/github-tag-action@1.39.0
|
uses: anothrNick/github-tag-action@1.39.0
|
||||||
env:
|
env:
|
@ -19,6 +19,8 @@ if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
|||||||
|
|
||||||
shortcutHelper.setFilePath("./shortcuts.xml")
|
shortcutHelper.setFilePath("./shortcuts.xml")
|
||||||
|
|
||||||
|
val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "eu.kanade.tachiyomi"
|
namespace = "eu.kanade.tachiyomi"
|
||||||
compileSdk = AndroidConfig.compileSdk
|
compileSdk = AndroidConfig.compileSdk
|
||||||
@ -37,11 +39,20 @@ android {
|
|||||||
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters += setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
abiFilters += SUPPORTED_ABIS
|
||||||
}
|
}
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
splits {
|
||||||
|
abi {
|
||||||
|
isEnable = true
|
||||||
|
reset()
|
||||||
|
include(*SUPPORTED_ABIS.toTypedArray())
|
||||||
|
isUniversalApk = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
named("debug") {
|
named("debug") {
|
||||||
versionNameSuffix = "-${getCommitCount()}"
|
versionNameSuffix = "-${getCommitCount()}"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package eu.kanade.tachiyomi.data.updater
|
package eu.kanade.tachiyomi.data.updater
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@ -18,8 +19,20 @@ data class GithubRelease(
|
|||||||
* Get download link of latest release from the assets.
|
* Get download link of latest release from the assets.
|
||||||
* @return download link of latest release.
|
* @return download link of latest release.
|
||||||
*/
|
*/
|
||||||
fun getDownloadLink(): String =
|
fun getDownloadLink(): String {
|
||||||
assets[0].downloadLink
|
val apkVariant = when (Build.SUPPORTED_ABIS[0]) {
|
||||||
|
"arm64-v8a" -> "-arm64-v8a"
|
||||||
|
"armeabi-v7a" -> "-armeabi-v7a"
|
||||||
|
"x86" -> "-x86"
|
||||||
|
"x86_64" -> "-x86_64"
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// SY <--
|
||||||
|
return assets.find { it.downloadLink.contains("TachiyomiSY$apkVariant-") }?.downloadLink
|
||||||
|
// SY -->
|
||||||
|
?: assets[0].downloadLink
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assets class containing download url.
|
* Assets class containing download url.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user