Skip to content

Commit 23446ce

Browse files
committed
add .aab export
1 parent 7d2b58c commit 23446ce

8 files changed

Lines changed: 1208 additions & 22 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ dist/index.js.map
44
node_modules
55
build
66
ignore
7+
/output
8+
release.keystore
79

810
# Electron build artifacts
911
release/

Dockerfile

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Android builds currently work well with JDK 17 for modern AGP
1+
# Docker image for Android export with Play Store signing support
2+
3+
# Base image with Java 21 for Android SDK and Gradle
24
FROM eclipse-temurin:21-jdk-jammy
35

46
ARG ANDROID_SDK_ROOT=/opt/android-sdk
@@ -90,10 +92,31 @@ RUN CHROME_PATH=$(find /root/.cache/puppeteer -name chrome -type f | head -n 1)
9092
echo "Chrome installed at: $CHROME_PATH" && \
9193
chmod +x /etc/profile.d/puppeteer.sh
9294

93-
# Create entrypoint script that sources the environment
94-
RUN echo '#!/bin/sh\n\
95-
export PUPPETEER_EXECUTABLE_PATH=$(find /root/.cache/puppeteer -name chrome -type f | head -n 1)\n\
96-
exec node /app/dist/index.js "$@"' > /entrypoint.sh && \
95+
# Create directory for keystore (to be mounted as volume for Play Store builds)
96+
RUN mkdir -p /keystore
97+
98+
# Create entrypoint script with keystore support for signed Android builds
99+
RUN echo '#!/bin/bash\n\
100+
set -e\n\
101+
\n\
102+
# Set Puppeteer executable path\n\
103+
export PUPPETEER_EXECUTABLE_PATH=$(find /root/.cache/puppeteer -name chrome -type f | head -n 1)\n\
104+
\n\
105+
# Check for keystore configuration when building release\n\
106+
if [[ "$*" == *"--android-bundle"* ]] || [[ "$*" == *"--android-release"* ]]; then\n\
107+
if [ -z "$KEYSTORE_FILE" ] && [ ! -f "/keystore/release.keystore" ]; then\n\
108+
echo "Warning: No keystore found. Set KEYSTORE_FILE env var or mount keystore to /keystore/release.keystore"\n\
109+
fi\n\
110+
\n\
111+
# Export signing environment variables if not already set\n\
112+
export KEYSTORE_FILE=${KEYSTORE_FILE:-/keystore/release.keystore}\n\
113+
export KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD:-}\n\
114+
export KEY_ALIAS=${KEY_ALIAS:-release}\n\
115+
export KEY_PASSWORD=${KEY_PASSWORD:-}\n\
116+
fi\n\
117+
\n\
118+
# Execute the main application\n\
119+
exec node /app/dist/index.js "$@"' > /entrypoint.sh && \
97120
chmod +x /entrypoint.sh
98121

99122
EXPOSE 4000

PLAYSTORE_GUIDE.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Play Store AAB Build - Quick Guide
2+
3+
Complete workflow to build and upload a signed Android App Bundle (AAB) to Google Play Store.
4+
5+
---
6+
7+
## 📋 Prerequisites
8+
9+
### 1. Create Keystore (One-time Only)
10+
```bash
11+
keytool -genkey -v -keystore release.keystore -alias release \
12+
-keyalg RSA -keysize 2048 -validity 10000
13+
```
14+
**⚠️ Important:** Backup your keystore securely! You'll need it for all future updates.
15+
16+
### 2. Organize Your Course
17+
Put your markdown file in a clean folder (avoid large binaries or unrelated files):
18+
```bash
19+
mkdir -p ~/my-course
20+
cp your-course.md ~/my-course/
21+
# Copy any images/resources the course needs
22+
```
23+
24+
### 3. Set Up Google Play Console
25+
1. Go to [Google Play Console](https://play.google.com/console)
26+
2. Create a new app
27+
3. Fill in store listing details (title, description, screenshots)
28+
4. Set up app category and content rating
29+
30+
---
31+
32+
## 🏗️ Build Process
33+
34+
### Step 1: Build Docker Image
35+
```bash
36+
cd ~/LiaScript-Exporter
37+
docker build -t liascript-exporter-android .
38+
```
39+
40+
### Step 2: Build Signed AAB
41+
```bash
42+
docker run --rm \
43+
-v $(pwd)/release.keystore:/keystore/release.keystore \
44+
-v $(pwd)/output:/output \
45+
-v ~/my-course:/input \
46+
-e KEYSTORE_PASSWORD="your-password" \
47+
-e KEY_PASSWORD="your-key-password" \
48+
liascript-exporter-android \
49+
--input /input/your-course.md \
50+
--format android \
51+
--output /output/my-app \
52+
--android-bundle \
53+
--android-appId "com.yourcompany.yourapp" \
54+
--android-appName "Your App Name"
55+
```
56+
57+
**Output:** `output/my-app.aab` (ready for upload)
58+
59+
---
60+
61+
## 📤 Upload to Play Store
62+
63+
### Step 1: Create Release in Play Console
64+
1. Open [Google Play Console](https://play.google.com/console)
65+
2. Select your app
66+
3. Go to **Production****Create new release**
67+
4. Upload `output/my-app.aab`
68+
69+
### Step 2: Complete Release Details
70+
- **Release name:** e.g., "Version 1.0.0"
71+
- **Release notes:** Describe what's in your course
72+
- Click **Review release**
73+
74+
### Step 3: Submit for Review
75+
- Review all details
76+
- Click **Start rollout to Production**
77+
- Google will review your app (typically 1-3 days)
78+
79+
---
80+
81+
## 🔄 Updating Your App
82+
83+
When you need to update your course:
84+
85+
1. **Update your markdown file**
86+
2. **Increment version** in your build (optional: add `--android-versionCode` flag)
87+
3. **Rebuild AAB** with the same keystore and passwords
88+
4. **Upload to Play Console** as a new release
89+
90+
---
91+
92+
## ⚙️ Configuration Options
93+
94+
### Required Flags
95+
| Flag | Description | Example |
96+
|------|-------------|---------|
97+
| `--android-bundle` | Build AAB instead of APK | Required for Play Store |
98+
| `--android-appId` | Unique app identifier | `com.company.app` |
99+
| `--android-appName` | App display name | `"My Course"` |
100+
101+
### Optional Flags
102+
| Flag | Description | Default |
103+
|------|-------------|---------|
104+
| `--android-keystore` | Keystore file path | `/keystore/release.keystore` |
105+
| `--android-keystorePassword` | Keystore password | From `KEYSTORE_PASSWORD` env var |
106+
| `--android-keyPassword` | Key password | From `KEY_PASSWORD` env var |
107+
| `--android-keyAlias` | Key alias in keystore | `release` |
108+
| `--android-icon` | Custom app icon (1024x1024px) | LiaScript default |
109+
110+
---
111+
112+
## 🐛 Troubleshooting
113+
114+
### Build takes too long
115+
- **Cause:** Large files in course directory
116+
- **Fix:** Ensure only course files are in the input folder
117+
118+
### "No input defined" error
119+
- **Cause:** Course file not mounted correctly
120+
- **Fix:** Check `-v ~/my-course:/input` matches `--input /input/your-course.md`
121+
122+
### "Keystore file not found"
123+
- **Cause:** Keystore not mounted or wrong path
124+
- **Fix:** Verify `-v $(pwd)/release.keystore:/keystore/release.keystore`
125+
126+
### AAB file not created
127+
- **Cause:** Gradle build failed
128+
- **Fix:** Check error messages in build output, ensure passwords are correct
129+
130+
---
131+
132+
## 📚 Example: Complete Workflow
133+
134+
```bash
135+
# 1. Create keystore (first time only)
136+
keytool -genkey -v -keystore release.keystore -alias release \
137+
-keyalg RSA -keysize 2048 -validity 10000
138+
139+
# 2. Prepare course folder
140+
mkdir -p ~/courses/intro-to-physics
141+
cp intro-to-physics.md ~/courses/intro-to-physics/
142+
143+
# 3. Build Docker image
144+
cd ~/LiaScript-Exporter
145+
docker build -t liascript-exporter-android .
146+
147+
# 4. Build signed AAB
148+
docker run --rm \
149+
-v $(pwd)/release.keystore:/keystore/release.keystore \
150+
-v $(pwd)/output:/output \
151+
-v ~/courses/intro-to-physics:/input \
152+
-e KEYSTORE_PASSWORD="mySecretPass123" \
153+
-e KEY_PASSWORD="mySecretPass123" \
154+
liascript-exporter-android \
155+
--input /input/intro-to-physics.md \
156+
--format android \
157+
--output /output/physics-app \
158+
--android-bundle \
159+
--android-appId "com.education.physics" \
160+
--android-appName "Physics 101"
161+
162+
# 5. Upload output/physics-app.aab to Google Play Console
163+
```
164+
165+
---
166+
167+
## 📖 Additional Resources
168+
169+
- **Google Play Console:** https://play.google.com/console
170+
- **Play Console Help:** https://support.google.com/googleplay/android-developer
171+
- **App Signing Help:** https://developer.android.com/studio/publish/app-signing
172+
- **LiaScript Documentation:** https://liascript.github.io

dist/index.js

Lines changed: 15 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)