feat: enhance APK build process with keystore handling and fallback options
Some checks failed
Build Android APK / build (push) Has been cancelled

This commit is contained in:
2026-01-22 09:30:27 +01:00
parent 2bbd388524
commit ae3ce89516
2 changed files with 68 additions and 19 deletions

View File

@@ -34,12 +34,42 @@ jobs:
- name: Sync Capacitor
run: npx cap sync android
- name: Build APK
working-directory: android
run: ./gradlew assembleDebug
- name: Decode keystore
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/impostor.keystore
- name: Upload APK
uses: actions/upload-artifact@v3
- name: Create keystore.properties
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
run: |
cat > android/keystore.properties << EOF
storeFile=../impostor.keystore
storePassword=${{ secrets.KEYSTORE_PASSWORD }}
keyAlias=${{ secrets.KEY_ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
EOF
- name: Build Release APK
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
working-directory: android
run: ./gradlew assembleRelease --no-daemon
- name: Build Debug APK (fallback)
if: ${{ secrets.KEYSTORE_BASE64 == '' }}
working-directory: android
run: ./gradlew assembleDebug --no-daemon
- name: Upload Release APK
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
uses: actions/upload-artifact@v4
with:
name: impostor-game-release
path: android/app/build/outputs/apk/release/app-release.apk
retention-days: 30
- name: Upload Debug APK (fallback)
if: ${{ secrets.KEYSTORE_BASE64 == '' }}
uses: actions/upload-artifact@v4
with:
name: impostor-game-debug
path: android/app/build/outputs/apk/debug/app-debug.apk

View File

@@ -25,11 +25,6 @@ jobs:
distribution: 'temurin'
java-version: '21'
- name: Verify Java Version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
@@ -39,17 +34,41 @@ jobs:
- name: Sync Capacitor
run: npx cap sync android
- name: Build APK
working-directory: android
- name: Decode keystore
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
run: |
export JAVA_HOME="${JAVA_HOME}"
echo "Using Java from: $JAVA_HOME"
java -version
javac -version
./gradlew --version
./gradlew assembleDebug --no-daemon --stacktrace
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/impostor.keystore
- name: Upload APK
- name: Create keystore.properties
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
run: |
cat > android/keystore.properties << EOF
storeFile=../impostor.keystore
storePassword=${{ secrets.KEYSTORE_PASSWORD }}
keyAlias=${{ secrets.KEY_ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
EOF
- name: Build Release APK
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
working-directory: android
run: ./gradlew assembleRelease --no-daemon
- name: Build Debug APK (fallback)
if: ${{ secrets.KEYSTORE_BASE64 == '' }}
working-directory: android
run: ./gradlew assembleDebug --no-daemon
- name: Upload Release APK
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
uses: actions/upload-artifact@v4
with:
name: impostor-game-release
path: android/app/build/outputs/apk/release/app-release.apk
retention-days: 30
- name: Upload Debug APK (fallback)
if: ${{ secrets.KEYSTORE_BASE64 == '' }}
uses: actions/upload-artifact@v4
with:
name: impostor-game-debug