|
9 | 9 | Build-APK: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | steps: |
12 | | - - name: Setup Java |
13 | | - uses: actions/setup-java@v4 |
14 | | - with: |
15 | | - distribution: 'zulu' |
16 | | - java-version: '17' |
17 | | - |
18 | | - - name: Setup Python |
19 | | - uses: actions/setup-python@v4 |
20 | | - with: |
21 | | - python-version: '3.x' |
22 | | - |
23 | | - - name: Checkout repository |
| 12 | + - name: Checkout repo |
24 | 13 | uses: actions/checkout@v4 |
25 | 14 |
|
26 | 15 | - name: Restore debug keystore from GitHub Secrets |
27 | 16 | run: | |
28 | | - # Check if exist and use the secret named DEBUG_KEYSTORE |
29 | | - # The contents of the secret can be obtained from the debug.keystore.asc |
30 | | - # (refer to CONTRIBUTING.md for Using the local debug.keystore on the Github CI actions) |
| 17 | + # DEBUG_KEYSTORE should contain base64-encoded content of debug.keystore.asc |
| 18 | + # Create it with: cat debug.keystore.asc | base64 -w0 |
| 19 | + # Or use GPG: gpg -c --passphrase "debug0" --batch debug.keystore && base64 -w0 debug.keystore.gpg |
31 | 20 | if [[ ! "${{ secrets.DEBUG_KEYSTORE }}" = "" ]]; then |
32 | | - echo "${{ secrets.DEBUG_KEYSTORE }}" > "debug.keystore.asc" |
| 21 | + echo "Restoring debug keystore from GitHub secrets" |
| 22 | + echo "${{ secrets.DEBUG_KEYSTORE }}" | base64 -d > "debug.keystore.asc" |
33 | 23 | if [[ -s "debug.keystore.asc" ]]; then |
34 | | - echo "Restoring debug keystore from GitHub secrets" |
35 | 24 | gpg -d --passphrase "debug0" --batch "debug.keystore.asc" > "debug.keystore" |
| 25 | + echo "Debug keystore restored ($(wc -c < debug.keystore) bytes)" |
| 26 | + else |
| 27 | + echo "Warning: decoded keystore.asc is empty" |
36 | 28 | fi |
| 29 | + else |
| 30 | + echo "No DEBUG_KEYSTORE secret found, will auto-generate keystore" |
37 | 31 | fi |
38 | 32 |
|
39 | | - - name: Generate layouts and resources |
40 | | - run: | |
41 | | - # Create expected directory structure for Python scripts |
42 | | - mkdir -p srcs/layouts srcs/juloo.keyboard2 |
43 | | -
|
44 | | - # Copy layouts to expected location |
45 | | - if [ -d "src/main/layouts" ]; then |
46 | | - cp src/main/layouts/*.xml srcs/layouts/ |
47 | | - echo "Copied $(ls srcs/layouts/*.xml | wc -l) layout files" |
48 | | - fi |
49 | | -
|
50 | | - # Copy compose files to expected location |
51 | | - if [ -d "src/main/compose" ]; then |
52 | | - mkdir -p srcs/compose |
53 | | - cp -r src/main/compose/* srcs/compose/ |
54 | | - echo "Copied compose files" |
55 | | - fi |
56 | | -
|
57 | | - # Run resource generation with proper error handling |
58 | | - echo "Generating layouts..." |
59 | | - python gen_layouts.py || echo "Layout generation failed" |
60 | | -
|
61 | | - echo "Generating emoji data..." |
62 | | - python gen_emoji.py || echo "Emoji generation failed" |
| 33 | + - uses: actions/setup-java@v4 |
| 34 | + with: |
| 35 | + distribution: 'temurin' |
| 36 | + java-version: '17' |
63 | 37 |
|
64 | | - # Copy generated files to Kotlin locations |
65 | | - mkdir -p src/main/java/juloo/keyboard2 |
66 | | - if [ -f "srcs/juloo.keyboard2/ComposeKeyData.java" ]; then |
67 | | - cp srcs/juloo.keyboard2/ComposeKeyData.java src/main/java/juloo/keyboard2/ |
68 | | - echo "Copied generated ComposeKeyData.java" |
69 | | - fi |
| 38 | + - name: Setup Gradle |
| 39 | + uses: gradle/actions/setup-gradle@v4 |
70 | 40 |
|
71 | 41 | - name: Build debug APK |
72 | | - uses: gradle/gradle-build-action@v3 |
| 42 | + run: ./gradlew assembleDebug |
73 | 43 | env: |
74 | 44 | DEBUG_KEYSTORE: "debug.keystore" |
75 | 45 | DEBUG_KEYSTORE_PASSWORD: debug0 |
76 | 46 | DEBUG_KEY_ALIAS: debug |
77 | 47 | DEBUG_KEY_PASSWORD: debug0 |
78 | | - with: |
79 | | - arguments: assembleDebug |
80 | 48 |
|
81 | 49 | - name: Artifact naming |
82 | 50 | run: | |
|
0 commit comments