Skip to content

Commit 4e0ae35

Browse files
committed
fix(ci): sync workflow with UK and use base64-encoded keystore
Copied workflow structure from Julow/Unexpected-Keyboard make-apk.yml with modification to accept base64-encoded keystore.asc content. Setup instructions: 1. Create GPG-encrypted keystore: gpg -c --passphrase "debug0" --batch debug.keystore -o debug.keystore.asc 2. Base64 encode and set secret: cat debug.keystore.asc | base64 -w0 # Paste result as DEBUG_KEYSTORE secret — opus-4-5-20251101
1 parent a90209a commit 4e0ae35

1 file changed

Lines changed: 18 additions & 50 deletions

File tree

.github/workflows/build-apk.yml

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,42 @@ jobs:
99
Build-APK:
1010
runs-on: ubuntu-latest
1111
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
2413
uses: actions/checkout@v4
2514

2615
- name: Restore debug keystore from GitHub Secrets
2716
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
3120
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"
3323
if [[ -s "debug.keystore.asc" ]]; then
34-
echo "Restoring debug keystore from GitHub secrets"
3524
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"
3628
fi
29+
else
30+
echo "No DEBUG_KEYSTORE secret found, will auto-generate keystore"
3731
fi
3832
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'
6337

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
7040

7141
- name: Build debug APK
72-
uses: gradle/gradle-build-action@v3
42+
run: ./gradlew assembleDebug
7343
env:
7444
DEBUG_KEYSTORE: "debug.keystore"
7545
DEBUG_KEYSTORE_PASSWORD: debug0
7646
DEBUG_KEY_ALIAS: debug
7747
DEBUG_KEY_PASSWORD: debug0
78-
with:
79-
arguments: assembleDebug
8048

8149
- name: Artifact naming
8250
run: |

0 commit comments

Comments
 (0)