Skip to content

E2E Android Build (manual) #17

E2E Android Build (manual)

E2E Android Build (manual) #17

Workflow file for this run

name: E2E Android Build (manual)
on:
# Manual trigger. Pick the branch/tag to build via the GitHub
# "Use workflow from" selector (or `gh workflow run --ref <branch>`);
# checkout below builds whatever ref the run was dispatched on.
workflow_dispatch:
permissions:
contents: read
env:
NODE_VERSION: '22'
JAVA_VERSION: '17'
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Create dummy google-services.json for CI
run: |
cat > android/app/google-services.json << 'EOL'
{
"project_info": {
"project_number": "000000000000",
"project_id": "dummy-project-for-ci",
"storage_bucket": "dummy-project-for-ci.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:000000000000:android:0000000000000000",
"android_client_info": {
"package_name": "com.pocketpalai"
}
},
"api_key": [{
"current_key": "dummy-api-key-for-ci-builds"
}]
},
{
"client_info": {
"mobilesdk_app_id": "1:000000000000:android:1111111111111111",
"android_client_info": {
"package_name": "com.pocketpalai.e2e"
}
},
"api_key": [{
"current_key": "dummy-api-key-for-ci-builds"
}]
}
]
}
EOL
- name: Create dummy .env file for CI
run: |
cat > .env << 'EOL'
FIREBASE_FUNCTIONS_URL=https://dummy-firebase-url.com
SUPABASE_URL=https://dummy-supabase-url.supabase.co
SUPABASE_ANON_KEY=dummy-anon-key-for-ci-builds
PALSHUB_API_BASE_URL=https://dummy-palshub-api.com
APP_URL=pocketpal://app
ENABLE_PALSHUB_INTEGRATION=true
ENABLE_AUTHENTICATION=true
ENABLE_OFFLINE_MODE=true
GOOGLE_IOS_CLIENT_ID=dummy-ios-client-id.apps.googleusercontent.com
GOOGLE_WEB_CLIENT_ID=dummy-web-client-id.apps.googleusercontent.com
EOL
- name: Create dummy release keystore for CI
working-directory: android/app
run: |
keytool -genkeypair -v \
-storetype PKCS12 \
-keystore pocketpal-release-key.keystore \
-alias pocketpal_key_alias \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-storepass dummy-ci-password \
-keypass dummy-ci-password \
-dname "CN=CI Build, OU=CI, O=PocketPal, L=CI, S=CI, C=US"
- name: Build Android E2E APK
env:
APP_RELEASE_STORE_PASSWORD: dummy-ci-password
APP_RELEASE_KEY_PASSWORD: dummy-ci-password
run: |
cd android
E2E_BUILD=true ./gradlew assembleE2eReleaseE2e
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: e2e-android-apk
path: android/app/build/outputs/apk/e2e/releaseE2e/app-e2e-releaseE2e.apk
retention-days: 30