diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index b581f4aa..2a4b6f32 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -62,24 +62,28 @@ jobs: continue-on-error: true - name: Setup signing keystore - if: ${{ secrets.KEYSTORE_BASE64 != '' }} + env: + KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} run: | - # Decode keystore from secret (persistent key for consistent signatures) - echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/upload-keystore.jks - - # Create key.properties file - cat > android/key.properties << EOF - storePassword=${{ secrets.KEYSTORE_PASSWORD }} - keyPassword=${{ secrets.KEY_PASSWORD }} - keyAlias=${{ secrets.KEY_ALIAS }} + if [ -n "$KEYSTORE_BASE64" ]; then + echo "Setting up signing keystore..." + # Decode keystore from secret (persistent key for consistent signatures) + echo "$KEYSTORE_BASE64" | base64 -d > android/app/upload-keystore.jks + + # Create key.properties file + cat > android/key.properties << EOF + storePassword=$KEYSTORE_PASSWORD + keyPassword=$KEY_PASSWORD + keyAlias=$KEY_ALIAS storeFile=upload-keystore.jks EOF - - - name: Note about signing - if: ${{ secrets.KEYSTORE_BASE64 == '' }} - run: | - echo "⚠️ No signing keystore configured - APK will be signed with debug key" - echo "This is normal for forks. The APK will still work for testing." + else + echo "⚠️ No signing keystore configured - APK will be signed with debug key" + echo "This is normal for forks. The APK will still work for testing." + fi - name: Build APK run: |