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
66
77on :
88 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 :
329
3310jobs :
3411 buildApkFile :
4522
4623 - name : Allow gradlew permission
4724 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
4832
4933 - name : Build debug APK
5034 run : ./gradlew assembleDebug --warning-mode all
5842 uses : actions/upload-artifact@v3
5943 with :
6044 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 22.gradle
33app /build
44editor /build
5+ secrets.properties
56treeview /build
67app /src /main /java /android /code /editor /SketchLogger.java
Original file line number Diff line number Diff line change @@ -2,6 +2,27 @@ plugins {
22 id ' com.android.application'
33}
44
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+
526android {
627 compileSdk 32
728 buildToolsVersion " 33.0.2"
@@ -40,6 +61,25 @@ android {
4061 buildFeatures {
4162 viewBinding true
4263 }
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+ }
4383}
4484
4585dependencies {
You can’t perform that action at this time.
0 commit comments