mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
improve release process, generate split apks for each arch
This commit is contained in:
@@ -10,12 +10,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
match: ${{ steps.check-tag.outputs.match }}
|
||||
beta: ${{ steps.check-tag.outputs.beta }}
|
||||
steps:
|
||||
- id: check-tag
|
||||
run: |
|
||||
if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
|
||||
echo ::set-output name=match::true
|
||||
fi
|
||||
if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+.*-beta$ ]]; then
|
||||
echo ::set-output name=beta::true
|
||||
fi
|
||||
|
||||
build:
|
||||
needs: check
|
||||
@@ -63,23 +67,13 @@ jobs:
|
||||
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ env.RELEASE_VERSION }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ${{steps.sign_app.outputs.signedReleaseFile}}
|
||||
asset_name: ${{ env.RELEASE_VERSION }}.apk
|
||||
asset_content_type: application/zip
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
prerelease: needs.check.outputs.beta == 'true'
|
||||
files: |
|
||||
${{ steps.sign_app.signedReleaseFile0 }}
|
||||
${{ steps.sign_app.signedReleaseFile1 }}
|
||||
${{ steps.sign_app.signedReleaseFile2 }}
|
||||
${{ steps.sign_app.signedReleaseFile3 }}
|
||||
${{ steps.sign_app.signedReleaseFile4 }}
|
||||
|
||||
+16
-19
@@ -111,10 +111,6 @@ android {
|
||||
buildConfigField "boolean", "DEV_BUILD", "false"
|
||||
buildConfigField "String", "MAP_ACCESS_TOKEN", '"pk.eyJ1IjoiZGVsdGFjaGF0IiwiYSI6ImNqc3c1aWczMzBjejY0M28wZmU0a3cwMzMifQ.ZPTH9dFJaav06RAu4rTYHw"'
|
||||
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a" //, "x86", "x86_64"
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
buildConfigField("String", "TEST_ADDR", buildConfigProperty("TEST_ADDR"))
|
||||
@@ -139,12 +135,6 @@ android {
|
||||
|
||||
signingConfigs {
|
||||
signingConfigs {
|
||||
debug {
|
||||
// add `DC_DEBUG_STORE_FILE=/path/to/debug.keystore` to `~/.gradle/gradle.properties`
|
||||
if(project.hasProperty("DC_DEBUG_STORE_FILE" )) {
|
||||
storeFile file(DC_DEBUG_STORE_FILE )
|
||||
}
|
||||
}
|
||||
release {
|
||||
// can be defined at `~/.gradle/gradle.properties` or at "Build/Generate signed APK"
|
||||
if(project.hasProperty("DC_RELEASE_STORE_FILE")) {
|
||||
@@ -159,10 +149,6 @@ android {
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
minifyEnabled false
|
||||
applicationIdSuffix ".beta"
|
||||
}
|
||||
release {
|
||||
applicationIdSuffix ".lite2"
|
||||
// minification and proguard disabled for now.
|
||||
@@ -182,20 +168,31 @@ android {
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
fat {
|
||||
dimension "none"
|
||||
}
|
||||
gplay {
|
||||
dimension "none"
|
||||
applicationId "chat.delta"
|
||||
}
|
||||
}
|
||||
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
|
||||
project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9]
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
outputFileName = outputFileName
|
||||
variant.outputs.all { output ->
|
||||
output.outputFileName = output.outputFileName
|
||||
.replace("deltalab-android", "deltachat-lite")
|
||||
.replace(".apk", "-${variant.versionName}.apk")
|
||||
output.versionCodeOverride =
|
||||
project.ext.versionCodes.get(output.getFilter(
|
||||
com.android.build.OutputFile.ABI), 0) * 10000000 + android.defaultConfig.versionCode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
APP_PLATFORM := android-16
|
||||
APP_ABI := armeabi-v7a arm64-v8a # x86 x86_64
|
||||
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
|
||||
APP_STL := c++_static
|
||||
|
||||
+1
-1
Submodule jni/deltachat-core-rust updated: 1fa3cdd729...ebcf5e3521
+16
-15
@@ -93,21 +93,21 @@ if test -z $1 || test $1 = arm64-v8a; then
|
||||
cp target/aarch64-linux-android/$RELEASE/libdeltachat.a $jnidir/arm64-v8a
|
||||
fi
|
||||
|
||||
# if test -z $1 || test $1 = x86; then
|
||||
# echo "-- cross compiling to i686-linux-android (x86) --"
|
||||
# export CFLAGS=-D__ANDROID_API__=16
|
||||
# TARGET_CC=i686-linux-android16-clang \
|
||||
# cargo +`cat rust-toolchain` build $RELEASEFLAG --target i686-linux-android -p deltachat_ffi
|
||||
# cp target/i686-linux-android/$RELEASE/libdeltachat.a $jnidir/x86
|
||||
# fi
|
||||
if test -z $1 || test $1 = x86; then
|
||||
echo "-- cross compiling to i686-linux-android (x86) --"
|
||||
export CFLAGS=-D__ANDROID_API__=16
|
||||
TARGET_CC=i686-linux-android16-clang \
|
||||
cargo +`cat rust-toolchain` build $RELEASEFLAG --target i686-linux-android -p deltachat_ffi
|
||||
cp target/i686-linux-android/$RELEASE/libdeltachat.a $jnidir/x86
|
||||
fi
|
||||
|
||||
# if test -z $1 || test $1 = x86_64; then
|
||||
# echo "-- cross compiling to x86_64-linux-android (x86_64) --"
|
||||
# export CFLAGS=-D__ANDROID_API__=21
|
||||
# TARGET_CC=x86_64-linux-android21-clang \
|
||||
# cargo +`cat rust-toolchain` build $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi
|
||||
# cp target/x86_64-linux-android/$RELEASE/libdeltachat.a $jnidir/x86_64
|
||||
# fi
|
||||
if test -z $1 || test $1 = x86_64; then
|
||||
echo "-- cross compiling to x86_64-linux-android (x86_64) --"
|
||||
export CFLAGS=-D__ANDROID_API__=21
|
||||
TARGET_CC=x86_64-linux-android21-clang \
|
||||
cargo +`cat rust-toolchain` build $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi
|
||||
cp target/x86_64-linux-android/$RELEASE/libdeltachat.a $jnidir/x86_64
|
||||
fi
|
||||
|
||||
echo -- ndk-build --
|
||||
|
||||
@@ -123,11 +123,12 @@ if test $1; then
|
||||
else
|
||||
# We are compiling for all architectures:
|
||||
TMP=$(mktemp)
|
||||
sed "s/APP_ABI.*/APP_ABI := armeabi-v7a arm64-v8a/g" Application.mk >"$TMP"
|
||||
sed "s/APP_ABI.*/APP_ABI := armeabi-v7a arm64-v8a x86 x86_64/g" Application.mk >"$TMP"
|
||||
mv "$TMP" Application.mk
|
||||
fi
|
||||
|
||||
cd ..
|
||||
rm -fr libs/
|
||||
ndk-build
|
||||
|
||||
cd jni
|
||||
|
||||
Reference in New Issue
Block a user