Skip to content

Commit 80e54f4

Browse files
authored
Merge pull request #4 from Text-Mining/sign-apk-configs
Sign apk with gradle configs
2 parents 40ea48c + f7a8010 commit 80e54f4

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ captures/
5050

5151
# Keystore files
5252
# Uncomment the following lines if you do not want to check your keystore files in.
53-
#*.jks
53+
*.jks
5454
#*.keystore
5555

5656
# External native build folder generated in Android Studio 2.2 and later

.travis.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ android:
1010
- ".+"
1111
before_install:
1212
- openssl aes-256-cbc -K $encrypted_413ff43c2836_key -iv $encrypted_413ff43c2836_iv
13-
-in app/src/release/google-services.json.enc -out app/src/release/google-services.json -d
13+
-in encrypt.tar.enc -out encrypt.tar -d
14+
- tar xvf encrypt.tar
1415
- yes | sdkmanager "platforms;android-28"
1516
- yes | sdkmanager "build-tools;28.0.3"
1617
sudo: required
@@ -19,3 +20,14 @@ before_script:
1920
- chmod +x gradlew
2021
script:
2122
- "./gradlew assembleRelease --stacktrace"
23+
deploy:
24+
provider: releases
25+
skip_cleanup: true
26+
overwrite: true
27+
api_key:
28+
secure: UCRWawnW0UeH5RGEEf7Fwj9NN+GOrP4FygGGje6oSIKjbrQaJa8DhiF8ELJbElZD/4xHFcoud2M3OQxRGRkJqxbkhxCrPPrs6TMyT6FzU1UZi4932YCrgvWsWVyMA//edl7FlSFcAgjUd7XRCkZWQXjBjRjXL/3N1B+e4BSnGFTskOfjSOpx8LVZp6MkelbwM5tN/9UP7WT/N9fP12jzo8UgEfUGYriewPSlg8RGhoWps67L3zt/QVhRfboVtRn7dxE7IaApBHbfFrAF4wbYMjZ7cd+nlEi63g77/6IdjRwWvD28gC4TVVD3Kz1Nvlm+ndE0GK33/V2nAi+J4ir3g6swIq0m6IYij91EXFKsGZiznpJdLIW47si5Yrm73eDL+D5rEgjW95i+ksKvIlz+EH1CVny/pLFbmibjQWOIlfXd+xdqvre48kNT0GGC5RCuHRtq+FC84mz44jYvl0Ve/mXs2Xy3g6KdWnc1uewhiu5lMUQvTml/a/3SDFeudxfEOrW0jMllaTciQ7BlO+co4tanP4LmycoenkW179dagIC/MT6hFVxa2Ao1qV3yMmJo+Q/4dJUA9+oN5O78nL/CfJ93xqgCzAk6B44vbbU4VKk9JP83mMj5rVaIyeFv0ankIIFSlxPHADW77WK53uIN2KmKVgTY9yP2MwmfL/OhAJY=
29+
file_glob: true
30+
file: app/build/outputs/apk/release/PersianNER*.apk
31+
on:
32+
repo: Text-Mining/android-app
33+
tags: true

app/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,25 @@ android {
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
vectorDrawables.useSupportLibrary = true
1818
}
19+
signingConfigs {
20+
release
21+
}
1922
buildTypes {
2023
release {
24+
signingConfig signingConfigs.release
2125
minifyEnabled true
2226
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2327
}
2428
}
29+
def isRunningOnTravis = System.getenv("CI") == "true"
30+
31+
if (isRunningOnTravis) {
32+
// configure keystore
33+
signingConfigs.release.storeFile = file("../PersianNER-Keystore.jks")
34+
signingConfigs.release.storePassword = System.getenv("keystore_password")
35+
signingConfigs.release.keyAlias = System.getenv("keystore_alias")
36+
signingConfigs.release.keyPassword = System.getenv("keystore_alias_password")
37+
}
2538
compileOptions {
2639
sourceCompatibility JavaVersion.VERSION_1_8
2740
targetCompatibility JavaVersion.VERSION_1_8
-1 KB
Binary file not shown.

encrypt.tar.enc

7.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)