File tree Expand file tree Collapse file tree 5 files changed +34
-4
lines changed Expand file tree Collapse file tree 5 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,34 @@ jobs:
19
19
- name : Download repository
20
20
uses : actions/checkout@v3
21
21
22
+ - uses : actions/cache@v3
23
+ with :
24
+ path : |
25
+ ~/.gradle/caches
26
+ ~/.gradle/wrapper
27
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
28
+ restore-keys : |
29
+ ${{ runner.os }}-gradle-
30
+
22
31
- name : Setup Java
23
32
uses : actions/setup-java@v3
24
33
with :
25
34
distribution : ' adopt'
26
35
java-version : ' 17'
27
36
37
+ - name : Prepare Build Keys
38
+ if : ${{ github.event_name != 'pull_request' && github.repository == 'fossasia/pslab-android' }}
39
+ env :
40
+ ENCRYPTED_F10B5E0E5262_IV : ${{ secrets.ENCRYPTED_F10B5E0E5262_IV }}
41
+ ENCRYPTED_F10B5E0E5262_KEY : ${{ secrets.ENCRYPTED_F10B5E0E5262_KEY }}
42
+ run : |
43
+ bash scripts/prep-key.sh
44
+
28
45
- name : Build with Gradle
46
+ env :
47
+ STORE_PASS : ${{ secrets.STORE_PASS }}
48
+ ALIAS : ${{ secrets.ALIAS }}
49
+ KEY_PASS : ${{ secrets.KEY_PASS }}
29
50
run : |
30
51
bash ./gradlew build --stacktrace
31
52
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