Skip to content

Commit 8ac8124

Browse files
author
blin
committed
ci: fix release build keystore path + add Node.js 24 opt-in
Root cause of recent CI failures: The fallback signing path was ${ANDROID_HOME}/debug.keystore which resolves to /usr/local/lib/android/sdk/debug.keystore on ubuntu-latest runners — a path that does not exist. The actual debug keystore lives at ~/.android/debug.keystore. Fixes: - Add 'Ensure debug keystore exists' step that runs keytool to generate the keystore at ~/.android/debug.keystore if absent (idempotent) - Change fallback signing path to ${HOME}/.android/debug.keystore - Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true to env to opt into Node.js 24 for all actions before the June 2026 forced cutover - Add Deployment & CI Checklist to copilot-instructions.md with common failure modes table so this is easy to diagnose in future
1 parent a298fda commit 8ac8124

2 files changed

Lines changed: 56 additions & 4 deletions

File tree

.github/copilot-instructions.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,35 @@ Before adding ANY new dependency:
128128
- `BuildConfig.DEBUG` guards must wrap all verbose drive mode logging.
129129
- The `com.android.shell` entry in `isMessagingApp()` is gated on `BuildConfig.DEBUG` — keep it that way.
130130
- `DebugTestReceiver` is gated on `BuildConfig.DEBUG` — keep it that way.
131+
132+
---
133+
134+
## Deployment & CI Checklist
135+
136+
**After every push to master, check the CI pipeline immediately:**
137+
138+
1. Open [Actions → Build and Release](https://github.com/KonTy/SilentPulse/actions/workflows/release.yml)
139+
2. Wait for the run to complete (~7–8 minutes).
140+
3. If it fails, click the failed job → expand each step to find the first non-zero exit.
141+
4. Fix the root cause, push, and re-verify the next run passes before deploying to a device.
142+
143+
### Common failure modes to know
144+
145+
| Symptom | Root cause | Fix |
146+
|---|---|---|
147+
| `packageNoAnalyticsRelease FAILED` with no keystore secret | Wrong keystore path | Workflow now uses `${HOME}/.android/debug.keystore`; a `keytool` pre-step guarantees it exists |
148+
| APK glob `*.apk` matches nothing in release step | Release build failed silently | Check the `assembleNoAnalyticsRelease` step above it |
149+
| Node.js 20 action warning becomes error (after Jun 2026) | Outdated action runtime | `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true` is set in the workflow env |
150+
151+
### Signing secrets (for production releases)
152+
153+
Set these in **Settings → Secrets and variables → Actions** on the repo:
154+
155+
| Secret | Value |
156+
|---|---|
157+
| `KEYSTORE_BASE64` | `base64 -w0 release.jks` output |
158+
| `KEYSTORE_PASSWORD` | Keystore password |
159+
| `KEY_ALIAS` | Key alias inside the keystore |
160+
| `KEY_PASSWORD` | Key password |
161+
162+
If secrets are absent the workflow falls back to a debug keystore so builds always succeed.

.github/workflows/release.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: write
1111

12+
env:
13+
# Opt into Node.js 24 for all actions before the June 2026 forced cutover.
14+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
15+
1216
jobs:
1317
build:
1418
name: Build & Release APK
@@ -48,9 +52,23 @@ jobs:
4852
- name: Build debug APK
4953
run: ./gradlew :presentation:assembleNoAnalyticsDebug
5054

51-
# If KEYSTORE_BASE64 secret is set, sign with the production keystore.
52-
# Otherwise fall back to the Android debug keystore so the build
53-
# never fails due to a missing production key.
55+
# Ensure the Android debug keystore exists at ~/.android/debug.keystore
56+
# before the release build. The debug APK step creates it automatically,
57+
# but an explicit keytool call makes the path predictable and avoids
58+
# the failure mode where ANDROID_HOME/debug.keystore (wrong path) is used.
59+
- name: Ensure debug keystore exists
60+
run: |
61+
mkdir -p ~/.android
62+
if [ ! -f ~/.android/debug.keystore ]; then
63+
keytool -genkeypair -v \
64+
-keystore ~/.android/debug.keystore \
65+
-alias androiddebugkey \
66+
-keyalg RSA -keysize 2048 \
67+
-validity 10000 \
68+
-storepass android -keypass android \
69+
-dname "CN=Android Debug,O=Android,C=US"
70+
fi
71+
5472
- name: Build release APK
5573
run: |
5674
if [ -n "${{ secrets.KEYSTORE_BASE64 }}" ]; then
@@ -61,8 +79,10 @@ jobs:
6179
-Pandroid.injected.signing.key.alias="${{ secrets.KEY_ALIAS }}" \
6280
-Pandroid.injected.signing.key.password="${{ secrets.KEY_PASSWORD }}"
6381
else
82+
# No production keystore configured — sign with the debug key.
83+
# The keystore was guaranteed to exist by the step above.
6484
./gradlew :presentation:assembleNoAnalyticsRelease \
65-
-Pandroid.injected.signing.store.file="${ANDROID_HOME}/debug.keystore" \
85+
-Pandroid.injected.signing.store.file="${HOME}/.android/debug.keystore" \
6686
-Pandroid.injected.signing.store.password=android \
6787
-Pandroid.injected.signing.key.alias=androiddebugkey \
6888
-Pandroid.injected.signing.key.password=android

0 commit comments

Comments
 (0)