File tree Expand file tree Collapse file tree 5 files changed +87
-24
lines changed Expand file tree Collapse file tree 5 files changed +87
-24
lines changed Original file line number Diff line number Diff line change @@ -6,29 +6,6 @@ name: Android CI
6
6
7
7
on :
8
8
push :
9
- branches :
10
- - main
11
- paths :
12
- - ' .github/**'
13
- - ' app/**'
14
- - ' editor/**'
15
- - ' gradle/**'
16
- - ' gradle.properties'
17
- - ' gradlew'
18
- - ' settings.gradle'
19
- pull_request :
20
- branches :
21
- - main
22
- paths :
23
- - ' .github/**'
24
- - ' app/**'
25
- - ' editor/**'
26
- - ' gradle/**'
27
- - ' build.gradle'
28
- - ' gradle.properties'
29
- - ' gradlew'
30
- - ' settings.gradle'
31
- workflow_dispatch :
32
9
33
10
jobs :
34
11
buildApkFile :
45
22
46
23
- name : Allow gradlew permission
47
24
run : chmod +x ./gradlew
25
+
26
+ - name : Set environmental variables
27
+ shell : bash
28
+ env :
29
+ JSON_CONTENT : ${{ secrets.KEYSTOREPASSWORD }}
30
+ run : |
31
+ printf 'KEYSTOREPASSWORD<<EOF\n%s\nEOF\n' "$JSON_CONTENT" >> $GITHUB_ENV
48
32
49
33
- name : Build debug APK
50
34
run : ./gradlew assembleDebug --warning-mode all
58
42
uses : actions/upload-artifact@v3
59
43
with :
60
44
name : Editor Debug Aar
61
- path : editor/build/outputs/aar/editor-debug.aar
45
+ path : editor/build/outputs/aar/editor-debug.aar
Original file line number Diff line number Diff line change
1
+ # SPDX-License-Identifier: GPL-3.0-only
2
+ # Original at https://github.com/tyron12233/CodeAssist/blob/main/.github/workflows/build-apk.yml
3
+ # Changes: Minor adjustments, removal of Cancel previous runs step, but every change can be found with a simple diff.
4
+
5
+ name : Android CI[PR]
6
+
7
+ on :
8
+ pull_request :
9
+
10
+ jobs :
11
+ buildApkFile :
12
+ name : Build Debug APK
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - uses : actions/checkout@v3
16
+
17
+ - name : Set up JDK 17
18
+ uses : actions/setup-java@v3
19
+ with :
20
+ java-version : 17
21
+ distribution : temurin
22
+
23
+ - name : Allow gradlew permission
24
+ run : chmod +x ./gradlew
25
+
26
+ - name : Build debug APK
27
+ run : ./gradlew assembleDebug --warning-mode all
28
+
29
+ - name : Upload debug APK
30
+ uses : actions/upload-artifact@v3
31
+ with :
32
+ name : Android Code Editor Debug Apk
33
+ path : app/build/outputs/apk/debug
34
+ - name : Upload editor aar debug
35
+ uses : actions/upload-artifact@v3
36
+ with :
37
+ name : Editor Debug Aar
38
+ path : editor/build/outputs/aar/editor-debug.aar
Original file line number Diff line number Diff line change 2
2
.gradle
3
3
app /build
4
4
editor /build
5
+ secrets.properties
5
6
treeview /build
6
7
app /src /main /java /android /code /editor /SketchLogger.java
Original file line number Diff line number Diff line change @@ -2,6 +2,27 @@ plugins {
2
2
id ' com.android.application'
3
3
}
4
4
5
+ def KEYSTOREPASSWORD = System . getenv(' KEYSTOREPASSWORD' )
6
+ def secretsPropertiesFile = file(' ../secrets.properties' )
7
+ def secretsProperties = new Properties ()
8
+
9
+ if (secretsPropertiesFile. exists()) {
10
+ secretsProperties. load(new FileInputStream (secretsPropertiesFile))
11
+ }
12
+
13
+ def signingEnabled = false
14
+ def password = " "
15
+
16
+ if (KEYSTOREPASSWORD != " " ) {
17
+ password = KEYSTOREPASSWORD
18
+ signingEnabled = true
19
+ } else if (secretsPropertiesFile. exists()) {
20
+ if (secretsProperties. getProperty(' keyStorePassword' ) != null ) {
21
+ password = secretsProperties. getProperty(' keyStorePassword' )
22
+ signingEnabled = true
23
+ }
24
+ }
25
+
5
26
android {
6
27
compileSdk 32
7
28
buildToolsVersion " 33.0.2"
@@ -40,6 +61,25 @@ android {
40
61
buildFeatures {
41
62
viewBinding true
42
63
}
64
+
65
+ signingConfigs {
66
+ release {
67
+ if (signingEnabled) {
68
+ storeFile file(" ../keystore.jks" )
69
+ storePassword password
70
+ keyAlias " AndroidCodeEditor"
71
+ keyPassword password
72
+ }
73
+ }
74
+ debug {
75
+ if (signingEnabled) {
76
+ storeFile file(" ../keystore.jks" )
77
+ storePassword password
78
+ keyAlias " AndroidCodeEditor"
79
+ keyPassword password
80
+ }
81
+ }
82
+ }
43
83
}
44
84
45
85
dependencies {
You can’t perform that action at this time.
0 commit comments