File tree 5 files changed +32
-8
lines changed
5 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,28 @@ jobs:
19
19
- name : Download repository
20
20
uses : actions/checkout@v3
21
21
22
- - name : Setup Java
23
- uses : actions/setup-java@v3
22
+ - uses : actions/cache@v3
24
23
with :
25
- distribution : ' adopt'
26
- java-version : ' 17'
24
+ path : |
25
+ ~/.gradle/caches
26
+ ~/.gradle/wrapper
27
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
28
+ restore-keys : |
29
+ ${{ runner.os }}-gradle-
30
+
31
+ - name : Prepare Build Keys
32
+ if : ${{ github.event_name != 'pull_request' && github.repository == 'fossasia/pslab-android' }}
33
+ env :
34
+ ENCRYPTED_F10B5E0E5262_IV : ${{ secrets.ENCRYPTED_F10B5E0E5262_IV }}
35
+ ENCRYPTED_F10B5E0E5262_KEY : ${{ secrets.ENCRYPTED_F10B5E0E5262_KEY }}
36
+ run : |
37
+ bash scripts/prep-key.sh
27
38
28
39
- name : Build with Gradle
40
+ env :
41
+ STORE_PASS : ${{ secrets.STORE_PASS }}
42
+ ALIAS : ${{ secrets.ALIAS }}
43
+ KEY_PASS : ${{ secrets.KEY_PASS }}
29
44
run : |
30
45
bash ./gradlew build --stacktrace
31
46
bash ./gradlew bundle --stacktrace
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ plugins {
4
4
5
5
apply (plugin = " realm-android" )
6
6
7
- val keystoreExists = System .getenv(" KEYSTORE_FILE" ) != null
7
+ val KEYSTORE_FILE = rootProject.file(" scripts/key.jks" )
8
+ val GITHUB_BUILD = System .getenv(" GITHUB_ACTIONS" ) == " true" && KEYSTORE_FILE .exists()
8
9
9
10
android {
10
11
namespace = " io.pslab"
@@ -19,9 +20,9 @@ android {
19
20
}
20
21
21
22
signingConfigs {
22
- if (keystoreExists ) {
23
+ if (GITHUB_BUILD ) {
23
24
register(" release" ) {
24
- storeFile = file( System .getenv( " KEYSTORE_FILE" ))
25
+ storeFile = KEYSTORE_FILE
25
26
storePassword = System .getenv(" STORE_PASS" )
26
27
keyAlias = System .getenv(" ALIAS" )
27
28
keyPassword = System .getenv(" KEY_PASS" )
@@ -41,7 +42,7 @@ android {
41
42
" proguard-rules.pro"
42
43
)
43
44
resValue(" string" , " version" , " ${defaultConfig.versionName} " )
44
- signingConfig = if (keystoreExists ) signingConfigs.getByName(" release" ) else null
45
+ signingConfig = if (GITHUB_BUILD ) signingConfigs.getByName(" release" ) else null
45
46
}
46
47
}
47
48
lint {
Original file line number Diff line number Diff line change
1
+ * .jks
2
+ fastlane.json
3
+ secrets.tar
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+
4
+ openssl aes-256-cbc -K $ENCRYPTED_F10B5E0E5262_KEY -iv $ENCRYPTED_F10B5E0E5262_IV -in ./scripts/secrets.tar.enc -out ./scripts/secrets.tar -d
5
+ tar xvf ./scripts/secrets.tar -C scripts/
You can’t perform that action at this time.
0 commit comments